Chris Hance. Where do patterns come from?  Canonical Answer  Design Patterns: Elements of Reusable Object- Oriented Software, “Gang Of Four”  Patterns.

Slides:



Advertisements
Similar presentations
Module 1: Creating an Application by Using Windows Presentation Foundation Overview of WPF Creating a Simple WPF Application Handling Events and Commands.
Advertisements

Lab 9: Code Organization User Interface Lab: GUI Lab October 23 rd, 2013.
Software Testing with Visual Studio 2013 & Team Foundation Server 2013 Benjamin Day.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 More design patterns.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
Factory Method Joey Richey Kevin Gorski. Definition Allows a class developer define the interface for creating an object while retaining control of which.
Advanced Object-Oriented Programming Features
March Ron McFadyen1 Design Patterns In software engineering, a design pattern is a generally repeatable solution to a commonly-occurring problem.
February Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m.
Shailen Sukul Senior Solutions Architect EMC BSc | Mct | Mcpd (.Net 2/3.5) | Mcts (Sharepoint (MOSS/WSS), Biztalk, Web, Win, Dist Apps) | Mcsd.NET | Mcsd.
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Chapter 26 Applying Gang of Four Design Patterns 1CS6359 Fall 2012 John Cole.
Test Driven Development Derived from Dr. Fawcett’s notes Phil Pratt-Szeliga Fall 2009.
Proxy Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Design Patterns Discussion of pages: xi-11 Sections: Preface, Forward, Chapter
Design Patterns Trends and Case Study John Hurst June 2005.
The Design Discipline.
Systems Analysis and Design in a Changing World, Fifth Edition
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
Design Patterns.
Software Waterfall Life Cycle Requirements Construction Design Testing Delivery and Installation Operations and Maintenance Concept Exploration Prototype.
@benday #vslive Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
MVC and MVP. References enter.html enter.html
Chris Hance. Why “Re-”evolving?  NIH Epidemic  My name is Chris, and I’m a… VB6 Coder  YAGNI.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Chapter 6 Understanding the Structure of an Application: Procedures, Modules, and Classes.
Building an Offline Smart Client using Domain-Driven Design Principles Tim McCarthy.
CSSE 374: 3½ Gang of Four Design Patterns These slides derived from Steve Chenoweth, Shawn Bohner, Curt Clifton, and others involved in delivering 374.
12 Systems Analysis and Design in a Changing World, Fifth Edition.
‘Tirgul’ # 7 Enterprise Development Using Visual Basic 6.0 Autumn 2002 Tirgul #7.
1 Another group of Patterns Architectural Patterns.
ISP666 MVC & Design Patterns. Outline Review Event Programming Model Model-View-Controller Revisit Simple Calculator Break Design Patterns Exercise.
DaveAndAl.net Do Application Design Patterns Make Sense in ASP.NET? Alex Homer You may like to write these down now...
1 ITEC 3010 “Systems Analysis and Design, I” LECTURE 10: Use Case Realizations [Prof. Peter Khaiter]
Patterns in programming 1. What are patterns? “A design pattern is a general, reusable solution to a commonly occurring problem in software. A design.
Debugging. Compile problems Read the whole complaint! Runtime problems –Exceptions –Incorrect behavior.
Chapter 13 Logical Architecture and UML Package Diagrams 1CS6359 Fall 2012 John Cole.
DEV-36: Composite MVP – Building Blocks in Presentation Layer
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
A Practical Guide To Unit Testing John E. Boal TestDrivenDeveloper.com.
Object Oriented Software Development
Object Oriented Software Development
Part VII: Design Continuous
REFACTORINGREFACTORING. Realities Code evolves substantially during development Requirements changes 1%-4% per month on a project Current methodologies.
The Start Menu……..Exposed What you never knew existed.
Design Patterns. 1 Paradigm4 Concepts 9 Principles23 Patterns.
ANDROID AND MODEL / VIEW / CONTROLLER. Slide 2 Design Patters Common solutions to programming problems are called design patterns Design patterns are.
Using Software Design Patterns Bill Anderson. About me Fox developer since 1987 Fox developer since 1987 Program Director, Los Angeles Visual Foxpro Developers.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
SEA Side – Extreme Programming 1 SEA Side Software Engineering Annotations Architectural Patterns Professor Sara Stoecklin Director of Software Engineering-
UNDERSTANDING YOUR OPTIONS FOR CLIENT-SIDE DEVELOPMENT IN OFFICE 365 Mark Rackley
Benjamin Unit Testing & Test-Driven Development for Mere Mortals.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
Real world Windows Phone development
Presented by FACADE PATTERN
Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
Intent To provide a framework to manage the process of software salvage and promote loose coupling through message passing. Salvage means recycling significant.
How to be a Good Developer
Unit Testing & Test-Driven Development for Mere Mortals
Unit Testing & Test-Driven Development for Mere Mortals
08/15/09 Design Patterns James Brucker.
Object Oriented Design Patterns - Structural Patterns
Chapter 20 Object-Oriented Analysis and Design
Unit Testing & Test-Driven Development for Mere Mortals
CS 350 – Software Design Principles and Strategies – Chapter 14
11. MVC SE2811 Software Component Design
11. MVC SE2811 Software Component Design
An Introduction to the Model-View-ViewModel Pattern
Presentation transcript:

Chris Hance

Where do patterns come from?  Canonical Answer  Design Patterns: Elements of Reusable Object- Oriented Software, “Gang Of Four”  Patterns of Enterprise Application Architecture (PoEAA), Martin Fowler  Real Answer  “Lots of people do it this way.”

Lots of People are Wrong  Anti-pattern  Common practice that’s (usually) inefficient or incorrect.  Get used to “It Depends”  “Portland Pattern Repository's Wiki”

The Application  Record Student Arrivals / Departures  (Check In / Check Out)  Enforce rules on student custody, etc.  Integrate with a legacy VB6 system

Intent: Partial Rewrite  First stab at MVC/MVP/…  Isolate UI from Model  COM-compatible  Standardized Control behavior

Some (COM/VB6) Limitations  No constructor parameters  No overloading  Events "disappear" in interfaces

Attempt #1 UIUberDLL Model DAL DALStub Controls "Controller" Form How many DALs in one DLL?

Attempt #2 UIUberDLL Model IDAL Controls "Controller" Form DAL DALStub Circular Dependency New Rule: Model doesn't talk to the DAL.

Attempt #3 Factory UI Controls "Controller" Form Model IDAL DAL(Stub) Next: Add Interfaces.

Attempt #4: With Interfaces Factory UI Controls "Controller" Form Model DTO DAL(Stub) Interfaces ModelInterface DTOInterface FactoryInterface DALInterface

Still Awake? Figure 17. Obligatory Useless Diagram

Low Coupling! What is it good for?  Reusable Code?  Manageable Code  Won't somebody think of the maintenance programmers?

Back to the Application Concepts  Check-In/Check-Out  Student  Contact  School  Teacher  User

Multiple Factories UI Controls "Controller" Form CheckInOutInterfaces CheckInOutModelCheckInOutFactory CheckInOutDAL ContactInterfaces ContactModelContactFactory ContactDAL Separate the concepts for maintenance programmer sanity, and some reusability. Do I need School, Teacher, Student, etc?

Tour the Model That means open Visual Studio. Yes, now.

So About the UI  MVC  MVP (“retired” per Fowler)  Passive View  Supervising Controller  MVVM  Presentation Model

Supervising Controller Figure π¾. Supervising Controller Sequence Diagram

How to test the Controller? View Form Control(s) ViewInterfaces IForm IControl(s) Controller ViewStub FormStub ControlStub(s) Pick a View at Runtime

IControl(s)?  Yes, define ITextbox, ICheckbox, ad nauseam.  Need control wrappers that implement ITextbox, etc. = Adapter pattern.  Also useful for standardized control behavior. = Decorator pattern.

And a concession to VB6  VB6 can’t define events in interfaces  Events only work with Dim WithEvents txt As Textbox  They don’t fire for Dim WithEvents itxt As ITextbox

Alternate Event System  WeakReference to objects  String event / method name  Marshal.IsComObject()  TypeLibInfo.InvokeSub() for COM objects  MemberInfo.Invoke() for CLR objects  Parameters are ugly.

Tour the UI Or what I have of it. (Work in Progress) We can always fall back to VB6 sample code.

The Whole… Thing View Form Control(s) ViewInterfaces IForm IControl(s) Controller CheckInOutInterfaces CheckInOutModelCheckInOutFactory CheckInOutDALContactInterfaces ContactModelContactFactory ContactDAL Well, the Event library is omitted.

TODO  Replace custom DAL with NHibernate or similar (in lieu of manual caching).  Templates or other codegen for UI repetitiveness.  ObservableCollection?