Introduction to Patterns
Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.
Definition in the Pattern Community Definition: Pattern: A representation of a proven solution. Problem Applicable Forces Solution Consequences Benefits
Patterns I.WHAT II.WHEN III.HOW IV.WHY
Types of Patterns Programming Patterns Design Patterns Architectural Patterns Analysis Patterns
Programming Patterns
I.WHAT iterator, enumerator, collection II.WHEN during building code constructs III.HOW use predefined programming classes IV.WHY reuse of similar constructs Programming Patterns
Design Patterns
I.WHAT factory, decorator, builder, strategy II.WHEN during code of application control and business rules III.HOW use defined structures of classes IV.WHY reuse of similar application elements Design Patterns
I.WHAT person, contract, accounting post II.WHEN during code of domain III.HOW use defined structures of classes IV.WHY reuse of similar application elements Analysis Patterns
Types of Design Patterns Fundamental Design Patterns Creational Design Patterns Partitioning Patterns Behavioral Patterns Concurrency Patterns
Delegation Interface Immutable Proxy Fundamental Design Patterns (FDP)
Delegation Allows extension of a class so that other classes can call methods in that class Interface - Allows classes with some similar data to use polymorphism to execute behavior. Immutable – forbids any of an object’s state information to change after the object is created. Proxy - forces method calls to an object indirectly. Fundamental Design Patterns (FDP)
Creational Design Patterns Factory Method Abstract Factory Builder Prototype Singleton Object Pool
Creational Design Patterns Factory Method – Allows subtypes of classes so you can polymorphically call similar functions Builder – allows you to build other types of objects. Singleton – allows only one instance of a class at a time. Object Pool – allows limited instances of a class
Partitioning Patterns Layered Initialization Filter Composite
Partitioning Patterns Layered Initialization Filter Composite
Behavioral Patterns Chain of ResponsibilityState CommandNull Object Little LanguageStrategy MediatorTemplate Method SnapshotVisitor Observer
Concurrency Patterns Single Threaded Execution Guarded Suspension Balking Scheduler Read/Write Lock Producer-Consumer Two-Phase Termination
I.WHAT command, databasepool, tier II.WHEN during architecture coding III.HOW use predefined programming classes IV.WHY reuse of similar architecture elements Architectural Patterns
Presentation Architectural Patterns Model View Controller Application Controller Input Controller –Page Controller –Front Controller View Controller –Template View, Transform View, Two Step View
I.WHAT party, responsible, contract, … II.WHEN during analysis & domain prog. III.HOW build domain patterns IV.WHY reuse of similar domain constructs Analysis Patterns
Examples of Analysis Patterns: 1. Party 2. Accountability 3. Observation 4. Inventory 5. Accounting 6. Trading 7. Contracts 8. Facades Analysis Patterns