Академический Документы
Профессиональный Документы
Культура Документы
BehavioralPatterns
CreationalPatterns
ChainofResponsibility(223)Avoidcouplingthesenderofarequesttoits
AbstractFactory(87)Provideaninterfaceforcreatingfamiliesofrelatedor
receiverbygivingmorethanoneobjectachancetohandletherequest.Chainthe
dependentobjectswithoutspecifyingtheirconcreteclasses.
receivingobjectsandpasstherequestalongthechainuntilanobjecthandlesit.
Builder(97)Separatetheconstructionofacomplexobjectfromitsrepresentation Command(233)Encapsulatearequestasanobject,therebylettingyou
sothatthesameconstructionprocesscancreatedifferentrepresentations.
parameterizeclientswithdifferentrequests,queueorlogrequests,andsupport
undoableoperations.
FactoryMethod(107)Defineaninterfaceforcreatinganobject,butlet
subclassesdecidewhichclasstoinstantiate.FactoryMethodletsaclassdefer
Interpreter(243)Givenalanguage,definearepresentionforitsgrammaralong
instantiationtosubclasses.
withaninterpreterthatusestherepresentationtointerpretsentencesinthe
language.
Prototype(117)Specifythekindsofobjectstocreateusingaprototypical
instance,andcreatenewobjectsbycopyingthisprototype.
Iterator(257)Provideawaytoaccesstheelementsofanaggregateobject
sequentiallywithoutexposingitsunderlyingrepresentation.
Singleton(127)Ensureaclassonlyhasoneinstance,andprovideaglobalpoint
ofaccesstoit.
Mediator(273)Defineanobjectthatencapsulateshowasetofobjectsinteract.
Mediatorpromotesloosecouplingbykeepingobjectsfromreferringtoeachother
StructuralPatterns
explicitly,anditletsyouvarytheirinteractionindependently.
Adapter(139)Converttheinterfaceofaclassintoanotherinterfaceclients
Memento(283)Withoutviolatingencapsulation,captureandexternalizean
expect.Adapterletsclassesworktogetherthatcouldn'totherwisebecauseof
object'sinternalstatesothattheobjectcanberestoredtothisstatelater.
incompatibleinterfaces.
Observer(293)Defineaonetomanydependencybetweenobjectssothatwhen
Bridge(151)Decoupleanabstractionfromitsimplementationsothatthetwocan
oneobjectchangesstate,allitsdependentsarenotifiedandupdatedautomatically.
varyindependently.
Composite(163)Composeobjectsintotreestructurestorepresentpartwhole State(305)Allowanobjecttoalteritsbehaviorwhenitsinternalstatechanges.
Theobjectwillappeartochangeitsclass.
hierarchies.Compositeletsclientstreatindividualobjectsandcompositionsof
objectsuniformly. Strategy(315)Defineafamilyofalgorithms,encapsulateeachone,andmake
theminterchangeable.Strategyletsthealgorithmvaryindependentlyfromclients
Decorator(175)Attachadditionalresponsibilitiestoanobjectdynamically.
Decoratorsprovideaflexiblealternativetosubclassingforextendingfunctionality. thatuseit.
TemplateMethod(325)Definetheskeletonofanalgorithminanoperation,
Facade(185)Provideaunifiedinterfacetoasetofinterfacesinasubsystem.
deferringsomestepstosubclasses.TemplateMethodletssubclassesredefine
Facadedefinesahigherlevelinterfacethatmakesthesubsystemeasiertouse.
certainstepsofanalgorithmwithoutchangingthealgorithm'sstructure.
Flyweight(195)Usesharingtosupportlargenumbersoffinegrainedobjects
Visitor(331)Representanoperationtobeperformedontheelementsofan
efficiently.
objectstructure.Visitorletsyoudefineanewoperationwithoutchangingthe
Proxy(207)Provideasurrogateorplaceholderforanotherobjecttocontrol classesoftheelementsonwhichitoperates.
accesstoit.