Introduction to Patterns Introduction to Patterns Pattern Webster

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 Benefits Consequences

Patterns I. WHAT II. WHEN III. HOW IV. WHY

Types of Patterns Programming Patterns Design Patterns Architectural Patterns Analysis Patterns

Programming 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

Design 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

Analysis 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

Types of Design Patterns Fundamental Design Patterns Creational Design Patterns Partitioning Patterns Behavioral Patterns Concurrency Patterns

Fundamental Design Patterns (FDP) 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.

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 Responsibility State Command Null Object Little Language Strategy Mediator Template Method Snapshot Visitor Observer

Concurrency Patterns Single Threaded Execution Guarded Suspension Balking Scheduler Read/Write Lock Producer-Consumer Two-Phase Termination

Architectural Patterns I. WHAT command, databasepool, tier II. WHEN during architecture coding III. HOW use predefined programming classes IV. WHY reuse of similar architecture elements

Presentation Architectural Patterns • Model View Controller • Application Controller • Input Controller – Page Controller – Front Controller • View Controller – Template View, Transform View, Two Step View

Analysis Patterns 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. 2. 3. 4. 5. 6. 7. 8. Party Accountability Observation Inventory Accounting Trading Contracts Facades
- Slides: 23