Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something...

Post on 21-Jan-2016

222 views 0 download

Tags:

Transcript of Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something...

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

ConsequencesBenefits

Patterns

I. WHAT

II. WHEN

III.HOW

IV.WHY

Types of Patterns

Programming PatternsDesign PatternsArchitectural PatternsAnalysis 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 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

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. Party2. Accountability3. Observation4. Inventory5. Accounting6. Trading7. Contracts8. Facades

Analysis Patterns