SlideShare a Scribd company logo
1 of 2
Download to read offline
C     Abstract Factory                           S       Facade                                       S      Proxy                                                                                                                          Memento
                                                                                                                                                  Memento
                                                                                                                                                                                                                                    -state
                                                                                                                                                                                                    Caretaker
                                                                                                      B      Observer
S     Adapter                                    C       Factory Method
                                                                                                                                                  Type: Behavioral
                                                                                                     C       Singleton
S     Bridge                                     S       Flyweight
                                                                                                                                                  What it is:
                                                                                                                                                  Without violating encapsulation, capture
                                                                                                      B      State
C     Builder                                    B       Interpreter
                                                                                                                                                  and externalize an object's internal state
                                                                                                                                                  so that the object can be restored to this
                                                                                                      B      Strategy
B     Chain of Responsibility                    B       Iterator                                                                                                                                               Originator
                                                                                                                                                  state later.
                                                                                                                                                                                                    -state
                                                                                                      B      Template Method
B     Command                                    B       Mediator
                                                                                                                                                                                                    +setMemento(in m : Memento)
                                                                                                      B      Visitor
S     Composite                                  B       Memento                                                                                                                                    +createMemento()

S     Decorator                                  C       Prototype


                                                                                                                                                                                                         «interface»
                                                                                                                                                                                                                                notifies
                                                                                                                                                   Observer
                                                                                Chain of Responsibility                                                                                                                                         «interface»
                                                                successor
                                  «interface»                                                                                                                                                             Subject
                                                                                                                                                                                                                                                 Observer
                                   Handler                                                                                                                                                        +attach(in o : Observer)
       Client
                                                                                                                                                   Type: Behavioral                                                                         +update()
                                                                                Type: Behavioral
                              +handleRequest()                                                                                                                                                    +detach(in o : Observer)
                                                                                                                                                                                                  +notify()
                                                                                                                                                   What it is:
                                                                                What it is:
                                                                                                                                                   Define a one-to-many dependency between
                                                                                Avoid coupling the sender of a request to
                                                                                                                                                   objects so that when one object changes
                                                                                its receiver by giving more than one object
                                                                                                                                                   state, all its dependents are notified and
                                                                                a chance to handle the request. Chain the
                                                                                                                                                   updated automatically.
                                                                                receiving objects and pass the request
                                                                                                                                                                                                      ConcreteSubject                       ConcreteObserver
                                                                                                                                                                                                                              observes
                                                                                along the chain until an object handles it.
                 ConcreteHandler1             ConcreteHandler2
                                                                                                                                                                                                     -subjectState                         -observerState
                 +handleRequest()            +handleRequest()
                                                                                                                                                                                                                                           +update()




                                                                               Command                                                            State                                               Context
        Client                                        Invoker
                                                                                                                                                                                                +request()
                                                                                                                                                  Type: Behavioral                                                                «interface»
                                                                               Type: Behavioral
                                                                                                                                                                                                                                     State
                    ConcreteCommand                                                                                                               What it is:
                                                                               What it is:                                                                                                                                    +handle()
                                                                                                                                                  Allow an object to alter its behavior when
                                                                               Encapsulate a request as an object,
                    +execute()
                                                                                                                                                  its internal state changes. The object will
                                                                               thereby letting you parameterize clients
                                                                                                                                                  appear to change its class.
                                                                               with different requests, queue or log
                                                                               requests, and support undoable operations.
                                                  Command
       Receiver
                                            +execute()                                                                                                                                                             ConcreteState1             ConcreteState2
 +action()
                                                                                                                                                                                                                  +handle()                 +handle()




                                                                                                                                                  Strategy
        Client
                                                                               Interpreter                                                                                                            Context
                                                                                                                                                  Type: Behavioral                                                              «interface»
                                                                               Type: Behavioral                                                                                                                                  Strategy
                                 «interface»
                                                                                                                                                  What it is:
                                                                                                                                                                                                                             +execute()
                             AbstractExpression
       Context                                                                 What it is:                                                        Define a family of algorithms,
                             +interpret()                                      Given a language, define a representation                          encapsulate each one, and make them
                                                                               for its grammar along with an interpreter                          interchangeable. Lets the algorithm vary
                                                                               that uses the representation to interpret                          independently from
                                                                               sentences in the language.                                         clients that use it.
                                                                                                                                                                                                              ConcreteStrategyA            ConcreteStrategyB
     TerminalExpression              NonterminalExpression                                                                                                                                                    +execute()                   +execute()
    +interpret() : Context           +interpret() : Context




                              Client
                                                                                                                                                   Template Method
                                                                               Iterator                                                                                                                                AbstractClass
                                                                                                                                                                                                                     +templateMethod()
                                                                                                                                                   Type: Behavioral
                                                                               Type: Behavioral
                                                «interface»
        «interface»                                                                                                                                                                                                  #subMethod()
                                                  Iterator
        Aggregate                                                                                                                                  What it is:
                                                                               What it is:
                                            +next()                                                                                                Define the skeleton of an algorithm in an
    +createIterator()                                                          Provide a way to access the elements of
                                                                                                                                                   operation, deferring some steps to subclasses.
                                                                               an aggregate object sequentially without
                                                                                                                                                   Lets subclasses redefine certain steps
                                                                               exposing its underlying representation.
                                                                                                                                                   of an algorithm without changing the
                                                                                                                                                                                                                       ConcreteClass
                                                                                                                                                   algorithm's structure.
                                             ConcreteIterator                                                                                                                                                        +subMethod()
    ConcreteAggregate
                                            +next() : Context
+createIterator() : Context




                                                                                                                                                                                                    «interface»
                                                                                                                                                 Visitor
                          informs
                                                                               Mediator                                                                                                               Visitor
                                                 «interface»                                                                                                                                                                                        Client
      Mediator                                                                                                                                                                      +visitElementA(in a : ConcreteElementA)
                                                                                                                                                 Type: Behavioral
                                                 Colleague
                                                                               Type: Behavioral                                                                                     +visitElementB(in b : ConcreteElementB)
                                                                                                                                                 What it is:
                                                                               What it is:                                                                                                                                                       «interface»
                                                                                                                                                 Represent an operation to be
                                                                               Define an object that encapsulates how a                                                                                                                           Element
                                                                                                                                                 performed on the elements of an                 ConcreteVisitor
                                                                               set of objects interact. Promotes loose                                                                                                                      +accept(in v : Visitor)
                                                                                                                                                 object structure. Lets you define a
                                                                               coupling by keeping objects from referring
                                                                                                                                                 new operation without changing +visitElementA(in a : ConcreteElementA)
                                                                               to each other explicitly and it lets you vary
                          updates                                                                                                                the classes of the elements on      +visitElementB(in b : ConcreteElementB)
                                                                               their interactions independently.
                                                                                                                                                 which it operates.
ConcreteMediator                            ConcreteColleague
                                                                                                                                                                                     ConcreteElementA
                                                                                                                                                                                                                        ConcreteElementB
                                                                                                                                                                                    +accept(in v : Visitor)
                                                                                                                                                                                                                       +accept(in v : Visitor)
Copyright © 2007 Jason S. McDonald           Gamma, Erich; Helm, Richard; Johnson, Ralph; Vlissides, John (1995). Design Patterns: Elements of
                                                 Reusable Object-Oriented Software. Reading, Massachusetts: Addison Wesley Longman, Inc..
http://www.McDonaldLand.info
Adapter
     «interface»
                                                                                                               Proxy                                                    Client
      Adapter                               Client
                                                                 Type: Structural
 +operation()                                                                                                  Type: Structural
                                                                                                                                                                                                 «interface»
                                                                 What it is:                                                                                                                       Subject
                                                                                                               What it is:
                                                                 Convert the interface of a class into                                                                                     +request()
                                                                                                               Provide a surrogate or placeholder for
                                                                 another interface clients expect. Lets        another object to control access to it.
                                                                 classes work together that couldn't
  ConcreteAdapter
                                                                 otherwise because of incompatible
                                           Adaptee
                                                                 interfaces.
 -adaptee
                                     +adaptedOperation()                                                                                                                                          represents
                                                                                                                                                                      RealSubject                                                 Proxy
 +operation()
                                                                                                                                                                 +request()                                             +request()




     Abstraction                                                                                                                                                                                     Client
                                                                 Bridge                                         Abstract Factory
  +operation()
                                                                                                                                                             «interface»
                                                                 Type: Structural
                                  «interface»
                                                                                                                Type: Creational                           AbstractFactory
                                 Implementor
                                                                                                                                                                                                                           «interface»
                                                                                                                                                         +createProductA()
                                                                 What it is:
                              +operationImpl()                                                                                                                                                                           AbstractProduct
                                                                                                                What it is:                              +createProductB()
                                                                 Decouple an abstraction from its
                                                                                                                Provides an interface for creating
                                                                 implementation so that the two can vary
                                                                                                                families of related or dependent
                                                                 independently.
                                                                                                                objects without specifying their
                                                                                                                concrete class.
                                                                                                                                                          ConcreteFactory
  ConcreteImplementorA              ConcreteImplementorB                                                                                                                                                               ConcreteProduct
                                                                                                                                                         +createProductA()
  +operationImpl()                  +operationImpl()                                                                                                     +createProductB()



                   «interface»
                                                                                                                                                                                                                    «interface»
                                                                 Composite                                     Builder
                   Component                                                                                                                                         Director
                                                                                                                                                                                                                      Builder
                                                  children
            +operation()
                                                                                                                                                             +construct()                                     +buildPart()
                                                                 Type: Structural                              Type: Creational
            +add(in c : Composite)
            +remove(in c : Composite)
                                                                 What it is:                                   What it is:
            +getChild(in i : int)
                                                                 Compose objects into tree structures to       Separate the construction of a
                                                                 represent part-whole hierarchies. Lets        complex object from its representing
                                                                 clients treat individual objects and          so that the same construction
                                                                 compositions of objects uniformly.            process can create different                                                                     ConcreteBuilder
                                         Composite                                                             representations.
                                                                                                                                                                                                              +buildPart()
        Leaf                     +operation()                                                                                                                                                                 +getResult()
                                 +add(in c : Composite)
 +operation()
                                 +remove(in c : Composite)
                                 +getChild(in i : int)


     «interface»
                                                                 Decorator
                                      ConcreteComponent
                                                                                                                Factory Method                                                                                              Creator
     Component                                                                                                                                                         «interface»
                                      +operation()                                                                                                                       Product
  +operation()                                                                                                                                                                                                      +factoryMethod()
                                                                 Type: Structural                               Type: Creational
                                                                                                                                                                                                                    +anOperation()
                                                                 What it is:                                    What it is:
                                          Decorator
                                                                 Attach additional responsibilities to an       Define an interface for creating an
                                      +operation()               object dynamically. Provide a flexible         object, but let subclasses decide which
                                                                 alternative to sub-classing for extending      class to instantiate. Lets a class defer
                                                                 functionality.                                 instantiation to subclasses.
             ConcreteDecorator
                                                                                                                                                                                                                     ConcreteCreator
                                                                                                                                                                  ConcreteProduct
             -addedState
                                                                                                                                                                                                                    +factoryMethod()
             +operation()
             +addedBehavior()



                                                                                                                                                                  Client
                                                                 Facade                                         Prototype
                           Facade
                                           Complex system
                                                                                                                                                                                                 «interface»
                                                                 Type: Structural                               Type: Creational
                                                                                                                                                                                                 Prototype
                                                                                                                                                                                           +clone()
                                                                 What it is:                                    What it is:
                                                                 Provide a unified interface to a set of        Specify the kinds of objects to create
                                                                 interfaces in a subsystem. Defines a high-     using a prototypical instance, and
                                                                 level interface that makes the subsystem       create new objects by copying this
                                                                 easier to use.                                 prototype.

                                                                                                                                                                ConcretePrototype1                                 ConcretePrototype2
                                                                                                                                                               +clone()                                           +clone()




                                          «interface»
 FlyweightFactory
                                           Flyweight
                                                                 Flyweight                                     Singleton
+getFlyweight(in key)            +operation(in extrinsicState)
                                                                                                                                                                                                   Singleton
                                                                                                               Type: Creational
                                                                 Type: Structural
                                                                                                                                                                                          -static uniqueInstance
       Client                                                                                                  What it is:                                                                -singletonData
                                                                 What it is:
                                                                                                               Ensure a class only has one instance and
                                                                 Use sharing to support large numbers of                                                                                  +static instance()
                                                                                                               provide a global point of access to it.
                                                                 fine grained objects efficiently.                                                                                        +SingletonOperation()
              ConcreteFlyweight
         -intrinsicState
                                             UnsharedConcreteFlyweight
         +operation(in extrinsicState)
                                            -allState

                                            +operation(in extrinsicState)                                     Copyright © 2007 Jason S. McDonald      Gamma, Erich; Helm, Richard; Johnson, Ralph; Vlissides, John (1995). Design Patterns: Elements of
                                                                                                                                                          Reusable Object-Oriented Software. Reading, Massachusetts: Addison Wesley Longman, Inc..
                                                                                                              http://www.McDonaldLand.info

More Related Content

Viewers also liked

Viewers also liked (18)

11 Understanding and Influencing the PL/SQL Compilar
11 Understanding and Influencing the PL/SQL Compilar11 Understanding and Influencing the PL/SQL Compilar
11 Understanding and Influencing the PL/SQL Compilar
 
Transcript of Presentation(Simple & Compound Interest) for Audience
Transcript of Presentation(Simple & Compound Interest) for AudienceTranscript of Presentation(Simple & Compound Interest) for Audience
Transcript of Presentation(Simple & Compound Interest) for Audience
 
Case study what you can take to the bank(primary functions)
Case study   what you can take to the bank(primary functions)Case study   what you can take to the bank(primary functions)
Case study what you can take to the bank(primary functions)
 
09 Managing Dependencies
09 Managing Dependencies09 Managing Dependencies
09 Managing Dependencies
 
02 Writing Executable Statments
02 Writing Executable Statments02 Writing Executable Statments
02 Writing Executable Statments
 
07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development
 
06 Using More Package Concepts
06 Using More Package Concepts06 Using More Package Concepts
06 Using More Package Concepts
 
03 Writing Control Structures, Writing with Compatible Data Types Using Expli...
03 Writing Control Structures, Writing with Compatible Data Types Using Expli...03 Writing Control Structures, Writing with Compatible Data Types Using Expli...
03 Writing Control Structures, Writing with Compatible Data Types Using Expli...
 
08 Dynamic SQL and Metadata
08 Dynamic SQL and Metadata08 Dynamic SQL and Metadata
08 Dynamic SQL and Metadata
 
05 Creating Stored Procedures
05 Creating Stored Procedures05 Creating Stored Procedures
05 Creating Stored Procedures
 
Remote DBA Experts 11g Features
Remote DBA Experts 11g FeaturesRemote DBA Experts 11g Features
Remote DBA Experts 11g Features
 
04 Handling Exceptions
04 Handling Exceptions04 Handling Exceptions
04 Handling Exceptions
 
10 Creating Triggers
10 Creating Triggers10 Creating Triggers
10 Creating Triggers
 
Turbocharge SQL Performance in PL/SQL with Bulk Processing
Turbocharge SQL Performance in PL/SQL with Bulk ProcessingTurbocharge SQL Performance in PL/SQL with Bulk Processing
Turbocharge SQL Performance in PL/SQL with Bulk Processing
 
Oracle - Program with PL/SQL - Lession 04
Oracle - Program with PL/SQL - Lession 04Oracle - Program with PL/SQL - Lession 04
Oracle - Program with PL/SQL - Lession 04
 
Oracle - Program with PL/SQL - Lession 10
Oracle - Program with PL/SQL - Lession 10Oracle - Program with PL/SQL - Lession 10
Oracle - Program with PL/SQL - Lession 10
 
Oracle - Program with PL/SQL - Lession 18
Oracle - Program with PL/SQL - Lession 18Oracle - Program with PL/SQL - Lession 18
Oracle - Program with PL/SQL - Lession 18
 
Oracle - Program with PL/SQL - Lession 07
Oracle - Program with PL/SQL - Lession 07Oracle - Program with PL/SQL - Lession 07
Oracle - Program with PL/SQL - Lession 07
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Designpatternscard

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