DesignPatternScard.pdf

J

1

+visitElementA(in a : ConcreteElementA)
+visitElementB(in b : ConcreteElementB)
«interface»
Visitor
+visitElementA(in a : ConcreteElementA)
+visitElementB(in b : ConcreteElementB)
ConcreteVisitor +accept(in v : Visitor)
«interface»
Element
+accept(in v : Visitor)
ConcreteElementA
+accept(in v : Visitor)
ConcreteElementB
Client
Visitor
Type: Behavioral
What it is:
Represent an operation to be
performed on the elements of an
object structure. Lets you define a
new operation without changing
the classes of the elements on
which it operates.
+templateMethod()
#subMethod()
AbstractClass
+subMethod()
ConcreteClass
Template Method
Type: Behavioral
What it is:
Define the skeleton of an algorithm in an
operation, deferring some steps to subclasses.
Lets subclasses redefine certain steps
of an algorithm without changing the
algorithm's structure.
+execute()
ConcreteStrategyB
+execute()
«interface»
Strategy
Context
+execute()
ConcreteStrategyA
Strategy
Type: Behavioral
What it is:
Define a family of algorithms,
encapsulate each one, and make them
interchangeable. Lets the algorithm vary
independently from
clients that use it.
+handle()
ConcreteState1
+handle()
«interface»
State
+request()
Context
+handle()
ConcreteState2
State
Type: Behavioral
What it is:
Allow an object to alter its behavior when
its internal state changes. The object will
appear to change its class.
-subjectState
ConcreteSubject
+update()
-observerState
ConcreteObserver
+update()
«interface»
Observer
notifies
observes
+attach(in o : Observer)
+detach(in o : Observer)
+notify()
«interface»
Subject
Observer
Type: Behavioral
What it is:
Define a one-to-many dependency between
objects so that when one object changes
state, all its dependents are notified and
updated automatically.
-state
Memento
+setMemento(in m : Memento)
+createMemento()
-state
Originator
Caretaker
Memento
Type: Behavioral
What it is:
Without violating encapsulation, capture
and externalize an object's internal state
so that the object can be restored to this
state later.
Abstract Factory
C
Adapter
S
Bridge
S
Builder
C
Chain of Responsibility
B
Command
B
Composite
S
Decorator
S
Facade
S
Factory Method
C
Flyweight
S
Interpreter
B
Iterator
B
Mediator
B
Memento
B
Prototype
C
Proxy
S
Observer
B
Singleton
C
State
B
Strategy
B
Template Method
B
Visitor
B
Chain of Responsibility
+handleRequest()
«interface»
Handler
+handleRequest()
ConcreteHandler1
+handleRequest()
ConcreteHandler2
Client
successor
Type: Behavioral
What it is:
Avoid coupling the sender of a request to
its receiver by giving more than one object
a chance to handle the request. Chain the
receiving objects and pass the request
along the chain until an object handles it.
+execute()
ConcreteCommand
Client
Receiver
Invoker Command
Type: Behavioral
What it is:
Encapsulate a request as an object,
thereby letting you parameterize clients
with different requests, queue or log
requests, and support undoable operations.
+interpret()
«interface»
AbstractExpression
+interpret() : Context
TerminalExpression
Client
Context
+interpret() : Context
NonterminalExpression
Interpreter
Type: Behavioral
What it is:
Given a language, define a representation
for its grammar along with an interpreter
that uses the representation to interpret
sentences in the language.
+createIterator()
«interface»
Aggregate
+createIterator() : Context
ConcreteAggregate
+next()
«interface»
Iterator
+next() : Context
ConcreteIterator
Iterator
Type: Behavioral
What it is:
Provide a way to access the elements of
an aggregate object sequentially without
exposing its underlying representation.
Client
Mediator
ConcreteMediator ConcreteColleague
«interface»
Colleague
informs
updates
Mediator
Type: Behavioral
What it is:
Define an object that encapsulates how a
set of objects interact. Promotes loose
coupling by keeping objects from referring
to each other explicitly and it lets you vary
their interactions independently.
Copyright © 2007 Jason S. McDonald
http://www.McDonaldLand.info
Gamma, Erich; Helm, Richard; Johnson, Ralph; Vlissides, John (1995). Design Patterns: Elements of
Reusable Object-Oriented Software. Reading, Massachusetts: Addison Wesley Longman, Inc..
+execute()
Command
Facade
Complex system
Adapter
Type: Structural
What it is:
Convert the interface of a class into
another interface clients expect. Lets
classes work together that couldn't
otherwise because of incompatible
interfaces.
+adaptedOperation()
Adaptee
+operation()
«interface»
Adapter
+operation()
-adaptee
ConcreteAdapter
Client
+operationImpl()
«interface»
Implementor
+operation()
Abstraction
+operationImpl()
ConcreteImplementorA
+operationImpl()
ConcreteImplementorB
Bridge
Type: Structural
What it is:
Decouple an abstraction from its
implementation so that the two can vary
independently.
+operation()
Leaf +operation()
+add(in c : Composite)
+remove(in c : Composite)
+getChild(in i : int)
Composite
+operation()
+add(in c : Composite)
+remove(in c : Composite)
+getChild(in i : int)
«interface»
Component
children
Composite
Type: Structural
What it is:
Compose objects into tree structures to
represent part-whole hierarchies. Lets
clients treat individual objects and
compositions of objects uniformly.
+operation()
ConcreteComponent
+operation()
Decorator
+operation()
«interface»
Component
+operation()
+addedBehavior()
-addedState
ConcreteDecorator
Decorator
Type: Structural
What it is:
Attach additional responsibilities to an
object dynamically. Provide a flexible
alternative to sub-classing for extending
functionality.
Facade
Type: Structural
What it is:
Provide a unified interface to a set of
interfaces in a subsystem. Defines a high-
level interface that makes the subsystem
easier to use.
Flyweight
Type: Structural
What it is:
Use sharing to support large numbers of
fine grained objects efficiently.
+request()
RealSubject
+request()
Proxy
+request()
«interface»
Subject
Client
represents
Proxy
Type: Structural
What it is:
Provide a surrogate or placeholder for
another object to control access to it.
+static instance()
+SingletonOperation()
-static uniqueInstance
-singletonData
Singleton
Singleton
Type: Creational
What it is:
Ensure a class only has one instance and
provide a global point of access to it.
+clone()
ConcretePrototype2
+clone()
«interface»
Prototype
Client
+clone()
ConcretePrototype1
Prototype
Type: Creational
What it is:
Specify the kinds of objects to create
using a prototypical instance, and
create new objects by copying this
prototype.
«interface»
Product
ConcreteProduct
+factoryMethod()
ConcreteCreator
+factoryMethod()
+anOperation()
Creator
Factory Method
Type: Creational
What it is:
Define an interface for creating an
object, but let subclasses decide which
class to instantiate. Lets a class defer
instantiation to subclasses.
+buildPart()
«interface»
Builder
+buildPart()
+getResult()
ConcreteBuilder
+construct()
Director
Builder
Type: Creational
What it is:
Separate the construction of a
complex object from its representing
so that the same construction
process can create different
representations.
«interface»
AbstractProduct
ConcreteProduct
+createProductA()
+createProductB()
«interface»
AbstractFactory
+createProductA()
+createProductB()
ConcreteFactory
Client
Abstract Factory
Type: Creational
What it is:
Provides an interface for creating
families of related or dependent
objects without specifying their
concrete class.
+operation(in extrinsicState)
-intrinsicState
ConcreteFlyweight
+operation(in extrinsicState)
-allState
UnsharedConcreteFlyweight
+operation(in extrinsicState)
«interface»
Flyweight
+getFlyweight(in key)
FlyweightFactory
Client
Copyright © 2007 Jason S. McDonald
http://www.McDonaldLand.info
Gamma, Erich; Helm, Richard; Johnson, Ralph; Vlissides, John (1995). Design Patterns: Elements of
Reusable Object-Oriented Software. Reading, Massachusetts: Addison Wesley Longman, Inc..

Recomendados

A coding fool design patterns por
A coding fool design patternsA coding fool design patterns
A coding fool design patternsleo_priv00
2.5K vistas2 diapositivas
Proxy design pattern (Class Ambassador) por
Proxy design pattern (Class Ambassador)Proxy design pattern (Class Ambassador)
Proxy design pattern (Class Ambassador)Sameer Rathoud
4.1K vistas13 diapositivas
Working with Servlets por
Working with ServletsWorking with Servlets
Working with ServletsPeople Strategists
744 vistas30 diapositivas
Prophecy Of Design Patterns por
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patternspradeepkothiyal
1K vistas37 diapositivas
Binding business data to vaadin components por
Binding business data to vaadin componentsBinding business data to vaadin components
Binding business data to vaadin componentsPeter Lehto
959 vistas89 diapositivas
Software Design Patterns por
Software Design PatternsSoftware Design Patterns
Software Design PatternsPankhuree Srivastava
2.6K vistas52 diapositivas

Más contenido relacionado

Similar a DesignPatternScard.pdf

1204csharp por
1204csharp1204csharp
1204csharpg_hemanth17
565 vistas56 diapositivas
JavaScript por
JavaScriptJavaScript
JavaScriptBharti Gupta
786 vistas57 diapositivas
react-slides.pdf por
react-slides.pdfreact-slides.pdf
react-slides.pdfDayNightGaMiNg
2 vistas27 diapositivas
Validate your entities with symfony validator and entity validation api por
Validate your entities with symfony validator and entity validation apiValidate your entities with symfony validator and entity validation api
Validate your entities with symfony validator and entity validation apiRaffaele Chiocca
1.8K vistas53 diapositivas
Il 09 T3 William Spreitzer por
Il 09 T3 William SpreitzerIl 09 T3 William Spreitzer
Il 09 T3 William Spreitzerwspreitzer
209 vistas17 diapositivas
Overview of Microsoft .Net Remoting technology por
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyPeter R. Egli
3.4K vistas16 diapositivas

Similar a DesignPatternScard.pdf(20)

Validate your entities with symfony validator and entity validation api por Raffaele Chiocca
Validate your entities with symfony validator and entity validation apiValidate your entities with symfony validator and entity validation api
Validate your entities with symfony validator and entity validation api
Raffaele Chiocca1.8K vistas
Il 09 T3 William Spreitzer por wspreitzer
Il 09 T3 William SpreitzerIl 09 T3 William Spreitzer
Il 09 T3 William Spreitzer
wspreitzer209 vistas
Overview of Microsoft .Net Remoting technology por Peter R. Egli
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technology
Peter R. Egli3.4K vistas
GWT.create 2013: Introduction to GXT por niloc132
GWT.create 2013: Introduction to GXTGWT.create 2013: Introduction to GXT
GWT.create 2013: Introduction to GXT
niloc1322.9K vistas
Reactive clean architecture por Viktor Nyblom
Reactive clean architectureReactive clean architecture
Reactive clean architecture
Viktor Nyblom481 vistas
Patterns of Enterprise Application Architecture (by example) por Paulo Gandra de Sousa
Patterns of Enterprise Application Architecture (by example)Patterns of Enterprise Application Architecture (by example)
Patterns of Enterprise Application Architecture (by example)
Paulo Gandra de Sousa25.1K vistas
2.dynamic por bashcode
2.dynamic2.dynamic
2.dynamic
bashcode946 vistas
Intake 37 linq3 por Mahmoud Ouf
Intake 37 linq3Intake 37 linq3
Intake 37 linq3
Mahmoud Ouf176 vistas
Silverlight 2 for Developers - TechEd New Zealand 2008 por Jonas Follesø
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
Jonas Follesø7.1K vistas
PDC Video on C# 4.0 Futures por nithinmohantk
PDC Video on C# 4.0 FuturesPDC Video on C# 4.0 Futures
PDC Video on C# 4.0 Futures
nithinmohantk675 vistas
Whats New In C# 4 0 - NetPonto por Paulo Morgado
Whats New In C# 4 0 - NetPontoWhats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPonto
Paulo Morgado1.2K vistas

Más de JTLai1

Ample_Guitar 使用手册 教程详解.pdf por
Ample_Guitar 使用手册 教程详解.pdfAmple_Guitar 使用手册 教程详解.pdf
Ample_Guitar 使用手册 教程详解.pdfJTLai1
19 vistas56 diapositivas
Ample Bass 使用手册 教程详解.pdf por
Ample Bass 使用手册 教程详解.pdfAmple Bass 使用手册 教程详解.pdf
Ample Bass 使用手册 教程详解.pdfJTLai1
10 vistas30 diapositivas
ギターと孤独と蒼い惑星G1.pdf por
ギターと孤独と蒼い惑星G1.pdfギターと孤独と蒼い惑星G1.pdf
ギターと孤独と蒼い惑星G1.pdfJTLai1
12 vistas1 diapositiva
ギターと孤独と蒼い惑星g1.pdf por
ギターと孤独と蒼い惑星g1.pdfギターと孤独と蒼い惑星g1.pdf
ギターと孤独と蒼い惑星g1.pdfJTLai1
7 vistas1 diapositiva
ギターと孤独と蒼い惑星.pdf por
ギターと孤独と蒼い惑星.pdfギターと孤独と蒼い惑星.pdf
ギターと孤独と蒼い惑星.pdfJTLai1
18 vistas1 diapositiva
J04_08.PDF por
J04_08.PDFJ04_08.PDF
J04_08.PDFJTLai1
19 vistas66 diapositivas

Más de JTLai1(20)

Ample_Guitar 使用手册 教程详解.pdf por JTLai1
Ample_Guitar 使用手册 教程详解.pdfAmple_Guitar 使用手册 教程详解.pdf
Ample_Guitar 使用手册 教程详解.pdf
JTLai119 vistas
Ample Bass 使用手册 教程详解.pdf por JTLai1
Ample Bass 使用手册 教程详解.pdfAmple Bass 使用手册 教程详解.pdf
Ample Bass 使用手册 教程详解.pdf
JTLai110 vistas
ギターと孤独と蒼い惑星G1.pdf por JTLai1
ギターと孤独と蒼い惑星G1.pdfギターと孤独と蒼い惑星G1.pdf
ギターと孤独と蒼い惑星G1.pdf
JTLai112 vistas
ギターと孤独と蒼い惑星g1.pdf por JTLai1
ギターと孤独と蒼い惑星g1.pdfギターと孤独と蒼い惑星g1.pdf
ギターと孤独と蒼い惑星g1.pdf
JTLai17 vistas
ギターと孤独と蒼い惑星.pdf por JTLai1
ギターと孤独と蒼い惑星.pdfギターと孤独と蒼い惑星.pdf
ギターと孤独と蒼い惑星.pdf
JTLai118 vistas
J04_08.PDF por JTLai1
J04_08.PDFJ04_08.PDF
J04_08.PDF
JTLai119 vistas
J04_06.PDF por JTLai1
J04_06.PDFJ04_06.PDF
J04_06.PDF
JTLai111 vistas
J04_05.PDF por JTLai1
J04_05.PDFJ04_05.PDF
J04_05.PDF
JTLai127 vistas
J04_04.PDF por JTLai1
J04_04.PDFJ04_04.PDF
J04_04.PDF
JTLai19 vistas
J04_3.PDF por JTLai1
J04_3.PDFJ04_3.PDF
J04_3.PDF
JTLai111 vistas
J04_2.PDF por JTLai1
J04_2.PDFJ04_2.PDF
J04_2.PDF
JTLai17 vistas
J04_1.PDF por JTLai1
J04_1.PDFJ04_1.PDF
J04_1.PDF
JTLai19 vistas
07 Structure, File.pdf por JTLai1
07 Structure, File.pdf07 Structure, File.pdf
07 Structure, File.pdf
JTLai114 vistas
2022 Oct. Healthcare Industry Update from PeopleSearch.pdf por JTLai1
2022 Oct. Healthcare Industry Update from PeopleSearch.pdf2022 Oct. Healthcare Industry Update from PeopleSearch.pdf
2022 Oct. Healthcare Industry Update from PeopleSearch.pdf
JTLai110 vistas
12_2022年台灣早期投資專題-人工智慧.pdf por JTLai1
12_2022年台灣早期投資專題-人工智慧.pdf12_2022年台灣早期投資專題-人工智慧.pdf
12_2022年台灣早期投資專題-人工智慧.pdf
JTLai19 vistas
13_2022年台灣早期投資專題-智慧製造.pdf por JTLai1
13_2022年台灣早期投資專題-智慧製造.pdf13_2022年台灣早期投資專題-智慧製造.pdf
13_2022年台灣早期投資專題-智慧製造.pdf
JTLai110 vistas
5G產業趨勢暨B5G關鍵議題分析_會員下載精華版.pdf por JTLai1
5G產業趨勢暨B5G關鍵議題分析_會員下載精華版.pdf5G產業趨勢暨B5G關鍵議題分析_會員下載精華版.pdf
5G產業趨勢暨B5G關鍵議題分析_會員下載精華版.pdf
JTLai175 vistas
2023年手機、NB、伺服器 供應鏈趨勢及市場展望 25NOV22.pdf por JTLai1
2023年手機、NB、伺服器 供應鏈趨勢及市場展望 25NOV22.pdf2023年手機、NB、伺服器 供應鏈趨勢及市場展望 25NOV22.pdf
2023年手機、NB、伺服器 供應鏈趨勢及市場展望 25NOV22.pdf
JTLai1121 vistas
2023年投資展望會-電子產業.pdf por JTLai1
2023年投資展望會-電子產業.pdf2023年投資展望會-電子產業.pdf
2023年投資展望會-電子產業.pdf
JTLai1515 vistas
楊金龍1111129簡報-「臺灣的通膨與貨幣政策:回顧與展望」.pdf por JTLai1
楊金龍1111129簡報-「臺灣的通膨與貨幣政策:回顧與展望」.pdf楊金龍1111129簡報-「臺灣的通膨與貨幣政策:回顧與展望」.pdf
楊金龍1111129簡報-「臺灣的通膨與貨幣政策:回顧與展望」.pdf
JTLai127 vistas

Último

Market Efficiency.pptx por
Market Efficiency.pptxMarket Efficiency.pptx
Market Efficiency.pptxRavindra Nath Shukla
30 vistas25 diapositivas
supplyfied .pdf por
supplyfied .pdfsupplyfied .pdf
supplyfied .pdfValueBusiness
19 vistas11 diapositivas
What is Credit Default Swaps por
What is Credit Default SwapsWhat is Credit Default Swaps
What is Credit Default SwapsMksSkyView
8 vistas10 diapositivas
Tax year 2024 Advance Taxation book by Khalid Petiwala por
Tax year 2024 Advance Taxation book by Khalid PetiwalaTax year 2024 Advance Taxation book by Khalid Petiwala
Tax year 2024 Advance Taxation book by Khalid PetiwalaSazzad Hossain, ITP, MBA, CSCA™
15 vistas477 diapositivas
Motivation Theory por
Motivation TheoryMotivation Theory
Motivation Theorylamluanvan.net Viết thuê luận văn
8 vistas11 diapositivas
1_updated_Axis India Manufacturing Fund-NFO One pager.pdf por
1_updated_Axis India Manufacturing Fund-NFO One pager.pdf1_updated_Axis India Manufacturing Fund-NFO One pager.pdf
1_updated_Axis India Manufacturing Fund-NFO One pager.pdfmultigainfinancial
14 vistas3 diapositivas

Último(20)

What is Credit Default Swaps por MksSkyView
What is Credit Default SwapsWhat is Credit Default Swaps
What is Credit Default Swaps
MksSkyView8 vistas
1_updated_Axis India Manufacturing Fund-NFO One pager.pdf por multigainfinancial
1_updated_Axis India Manufacturing Fund-NFO One pager.pdf1_updated_Axis India Manufacturing Fund-NFO One pager.pdf
1_updated_Axis India Manufacturing Fund-NFO One pager.pdf
multigainfinancial14 vistas
Stock Market Brief Deck 1129.pdf por Michael Silva
Stock Market Brief Deck 1129.pdfStock Market Brief Deck 1129.pdf
Stock Market Brief Deck 1129.pdf
Michael Silva53 vistas
Embracing the eFarming Challenge.pdf por ramadhan04116
Embracing the eFarming Challenge.pdfEmbracing the eFarming Challenge.pdf
Embracing the eFarming Challenge.pdf
ramadhan041165 vistas
QNBFS Daily Market Report November 29, 2023 por QNB Group
QNBFS Daily Market Report November 29, 2023QNBFS Daily Market Report November 29, 2023
QNBFS Daily Market Report November 29, 2023
QNB Group9 vistas
Indias Sparkling Future : Lab-Grown Diamonds in Focus por anujadeodhar4
Indias Sparkling Future : Lab-Grown Diamonds in FocusIndias Sparkling Future : Lab-Grown Diamonds in Focus
Indias Sparkling Future : Lab-Grown Diamonds in Focus
anujadeodhar47 vistas
Jeremy Hunt's letter to Nausicaa Delfas por Henry Tapper
Jeremy Hunt's letter to Nausicaa DelfasJeremy Hunt's letter to Nausicaa Delfas
Jeremy Hunt's letter to Nausicaa Delfas
Henry Tapper518 vistas
Topic 37 copy.pptx por saleh176
Topic 37 copy.pptxTopic 37 copy.pptx
Topic 37 copy.pptx
saleh1765 vistas
Macro Economics- Group Presentation for Germany por BethanyAline
Macro Economics- Group Presentation for Germany Macro Economics- Group Presentation for Germany
Macro Economics- Group Presentation for Germany
BethanyAline38 vistas
Development Economics.pptx por Nithin Kumar
Development Economics.pptxDevelopment Economics.pptx
Development Economics.pptx
Nithin Kumar9 vistas
score 10000.pdf por sadimd007
score 10000.pdfscore 10000.pdf
score 10000.pdf
sadimd0079 vistas

DesignPatternScard.pdf

  • 1. +visitElementA(in a : ConcreteElementA) +visitElementB(in b : ConcreteElementB) «interface» Visitor +visitElementA(in a : ConcreteElementA) +visitElementB(in b : ConcreteElementB) ConcreteVisitor +accept(in v : Visitor) «interface» Element +accept(in v : Visitor) ConcreteElementA +accept(in v : Visitor) ConcreteElementB Client Visitor Type: Behavioral What it is: Represent an operation to be performed on the elements of an object structure. Lets you define a new operation without changing the classes of the elements on which it operates. +templateMethod() #subMethod() AbstractClass +subMethod() ConcreteClass Template Method Type: Behavioral What it is: Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure. +execute() ConcreteStrategyB +execute() «interface» Strategy Context +execute() ConcreteStrategyA Strategy Type: Behavioral What it is: Define a family of algorithms, encapsulate each one, and make them interchangeable. Lets the algorithm vary independently from clients that use it. +handle() ConcreteState1 +handle() «interface» State +request() Context +handle() ConcreteState2 State Type: Behavioral What it is: Allow an object to alter its behavior when its internal state changes. The object will appear to change its class. -subjectState ConcreteSubject +update() -observerState ConcreteObserver +update() «interface» Observer notifies observes +attach(in o : Observer) +detach(in o : Observer) +notify() «interface» Subject Observer Type: Behavioral What it is: Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. -state Memento +setMemento(in m : Memento) +createMemento() -state Originator Caretaker Memento Type: Behavioral What it is: Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later. Abstract Factory C Adapter S Bridge S Builder C Chain of Responsibility B Command B Composite S Decorator S Facade S Factory Method C Flyweight S Interpreter B Iterator B Mediator B Memento B Prototype C Proxy S Observer B Singleton C State B Strategy B Template Method B Visitor B Chain of Responsibility +handleRequest() «interface» Handler +handleRequest() ConcreteHandler1 +handleRequest() ConcreteHandler2 Client successor Type: Behavioral What it is: Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it. +execute() ConcreteCommand Client Receiver Invoker Command Type: Behavioral What it is: Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations. +interpret() «interface» AbstractExpression +interpret() : Context TerminalExpression Client Context +interpret() : Context NonterminalExpression Interpreter Type: Behavioral What it is: Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language. +createIterator() «interface» Aggregate +createIterator() : Context ConcreteAggregate +next() «interface» Iterator +next() : Context ConcreteIterator Iterator Type: Behavioral What it is: Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation. Client Mediator ConcreteMediator ConcreteColleague «interface» Colleague informs updates Mediator Type: Behavioral What it is: Define an object that encapsulates how a set of objects interact. Promotes loose coupling by keeping objects from referring to each other explicitly and it lets you vary their interactions independently. Copyright © 2007 Jason S. McDonald http://www.McDonaldLand.info Gamma, Erich; Helm, Richard; Johnson, Ralph; Vlissides, John (1995). Design Patterns: Elements of Reusable Object-Oriented Software. Reading, Massachusetts: Addison Wesley Longman, Inc.. +execute() Command
  • 2. Facade Complex system Adapter Type: Structural What it is: Convert the interface of a class into another interface clients expect. Lets classes work together that couldn't otherwise because of incompatible interfaces. +adaptedOperation() Adaptee +operation() «interface» Adapter +operation() -adaptee ConcreteAdapter Client +operationImpl() «interface» Implementor +operation() Abstraction +operationImpl() ConcreteImplementorA +operationImpl() ConcreteImplementorB Bridge Type: Structural What it is: Decouple an abstraction from its implementation so that the two can vary independently. +operation() Leaf +operation() +add(in c : Composite) +remove(in c : Composite) +getChild(in i : int) Composite +operation() +add(in c : Composite) +remove(in c : Composite) +getChild(in i : int) «interface» Component children Composite Type: Structural What it is: Compose objects into tree structures to represent part-whole hierarchies. Lets clients treat individual objects and compositions of objects uniformly. +operation() ConcreteComponent +operation() Decorator +operation() «interface» Component +operation() +addedBehavior() -addedState ConcreteDecorator Decorator Type: Structural What it is: Attach additional responsibilities to an object dynamically. Provide a flexible alternative to sub-classing for extending functionality. Facade Type: Structural What it is: Provide a unified interface to a set of interfaces in a subsystem. Defines a high- level interface that makes the subsystem easier to use. Flyweight Type: Structural What it is: Use sharing to support large numbers of fine grained objects efficiently. +request() RealSubject +request() Proxy +request() «interface» Subject Client represents Proxy Type: Structural What it is: Provide a surrogate or placeholder for another object to control access to it. +static instance() +SingletonOperation() -static uniqueInstance -singletonData Singleton Singleton Type: Creational What it is: Ensure a class only has one instance and provide a global point of access to it. +clone() ConcretePrototype2 +clone() «interface» Prototype Client +clone() ConcretePrototype1 Prototype Type: Creational What it is: Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype. «interface» Product ConcreteProduct +factoryMethod() ConcreteCreator +factoryMethod() +anOperation() Creator Factory Method Type: Creational What it is: Define an interface for creating an object, but let subclasses decide which class to instantiate. Lets a class defer instantiation to subclasses. +buildPart() «interface» Builder +buildPart() +getResult() ConcreteBuilder +construct() Director Builder Type: Creational What it is: Separate the construction of a complex object from its representing so that the same construction process can create different representations. «interface» AbstractProduct ConcreteProduct +createProductA() +createProductB() «interface» AbstractFactory +createProductA() +createProductB() ConcreteFactory Client Abstract Factory Type: Creational What it is: Provides an interface for creating families of related or dependent objects without specifying their concrete class. +operation(in extrinsicState) -intrinsicState ConcreteFlyweight +operation(in extrinsicState) -allState UnsharedConcreteFlyweight +operation(in extrinsicState) «interface» Flyweight +getFlyweight(in key) FlyweightFactory Client Copyright © 2007 Jason S. McDonald http://www.McDonaldLand.info Gamma, Erich; Helm, Richard; Johnson, Ralph; Vlissides, John (1995). Design Patterns: Elements of Reusable Object-Oriented Software. Reading, Massachusetts: Addison Wesley Longman, Inc..