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

23
Introduction to Patterns

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

Page 1: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Introduction to Patterns                

Page 2: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Introduction to Patterns

               

Pattern:

Webster definition of Pattern:

Something regarded as a normative example to be copied.

Page 3: 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

Page 4: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Patterns

I. WHAT

II. WHEN

III.HOW

IV.WHY

Page 5: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Types of Patterns

Programming PatternsDesign PatternsArchitectural PatternsAnalysis Patterns

Page 6: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Programming Patterns

Page 7: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

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

Page 8: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Design Patterns

Page 9: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

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

Page 10: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

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

Page 11: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Types of Design Patterns

Fundamental Design Patterns

Creational Design Patterns

Partitioning Patterns

Behavioral Patterns

Concurrency Patterns

Page 12: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Delegation

Interface

Immutable

Proxy

Fundamental Design Patterns (FDP)

Page 13: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

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)

Page 14: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Creational Design Patterns

Factory Method

Abstract Factory

Builder

Prototype

Singleton

Object Pool

Page 15: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

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

Page 16: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Partitioning Patterns

Layered Initialization

Filter

Composite

Page 17: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Partitioning Patterns

Layered Initialization

Filter

Composite

Page 18: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Behavioral Patterns

Chain of Responsibility State

Command Null Object

Little Language Strategy

Mediator Template Method

Snapshot Visitor

Observer

Page 19: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Concurrency Patterns

Single Threaded Execution

Guarded Suspension

Balking

Scheduler

Read/Write Lock

Producer-Consumer

Two-Phase Termination

Page 20: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

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

Page 21: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

Presentation Architectural Patterns

• Model View Controller

• Application Controller

• Input Controller– Page Controller– Front Controller

• View Controller– Template View, Transform View, Two Step View

Page 22: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

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

Page 23: Introduction to Patterns. Introduction to Patterns Pattern: Webster definition of Pattern: Something regarded as a normative example to be copied.

              

  Examples of Analysis Patterns: 1. Party2. Accountability3. Observation4. Inventory5. Accounting6. Trading7. Contracts8. Facades

Analysis Patterns