Você está na página 1de 1

GOF Mnemonic Analogy HotSpot

AbsFactory platformindependenceforafamilyofproducts autobodypartsstampingpress host"platform"


Builder parseacomplexrepresenta.,createoneofseveraltargets assemblingfastfoodkids'meals creationofanaggregate'selements
FactoryMeth virtualcreationthroughinheritance injectionmoldingform subclassofobjectthatiscreated
Prototype virtualcreationthroughdelegation biologicalcelldivision classofobjectthatiscreated
Singleton guardianofthesingleinstance theofficeofthePresident thesoleinstanceofaclass

Adapter wrapalegacycomponent 1/2"to1/4"socketadapter interfaceofanobject


Bridge decoupleinterfaceandimplementation lightswitchonblueprint implementationofanobject
Composite recursivecomposition arithmeticexpression structureofanaggregate'selements
Decorator addskinstotheonion Christmastree,layeredcourier responsibilitiesofanobject
Facade simplefrontendtoacomplicatedsubsystem telephonesalesoperator interfaceofasubsystem
Flyweight usesharingtooptimizelotsof"little"objects thetelephonesystem storagecostofobjects
Proxy useasurrogatetocontrolaccess acheckorbankdraft locationand/oraccessofanobject

Chainof singleprocessingpipe,manypossiblehandlers vendingmachinecoinslot selectionofarequest'sreceiver


Responsibility
Command encapsulatearequestasanobject mealorderatarestaurant whenandhowarequestisrealized
Interpreter mapadomaingrammartoahiertosolvedomainproblems musicianreadingmusic grammarandinterpofalanguage
Iterator decoupletraversalofanaggregateobject secraccessingherfilesystem traversalofanaggregate'selements
Mediator provideanintermediarytodecouplemanypeers airportcontroltower interactionbetweenpeerobjects
Memento checkpoint/rollbackanobject'sinternalstate vendorsourcecodeinescrow externalizationofanobject'sinternalstate
Observer decoupledependent"views"fromtheindependentsubject auctioneerandbidders dependentview(s)ofanindependentobject
State object'sbehaviormorphsasitsstatechanges vendingmachinestatemachine statesofanobject
Strategy plugcompatiblealgorithms gettingtotheairport choiceofalgorithm
TemplateMeth constantalgorithm,replaceablesteps tracthomebuilder'soptions stepsofanalgorithm
Visitor decoupleoperationsonanaggregateobject thesubwayandanalldaypass operationsonanaggregate'selements

Você também pode gostar