Загрузил Станислав Перекрест

patterns rus

реклама
C
S
S
S
C
B
S
S
C
C
B
B
B
B
B
Memento
-state
Caretaker
Memento
:
:
B
B
B
S
B
B
S
C
Originator
-
-state
.
+setMemento(in m : Memento)
+createMemento()
«interface»
Subject
«interface»
Handler
Client
,
+handleRequest()
Observer
Chain of responsibility
:
:
:
«interface»
Observer
+attach(in o : Observer)
+detach(in o : Observer)
+notify()
+update()
:
“
,
”
,
,
ConcreteHandler1
ConcreteHandler2
+handleRequest()
.
-
-
+handleRequest()
ConcreteSubject
-
ConcreteObserver
-subjectState
.
-observerState
.
Client
+update()
Context
Invoker
Command
State
:
ConcreteCommand
+request()
«interface»
State
:
:
+handle()
:
+execute()
,
,
Command
Receiver
.
.
+execute()
+action()
,
ConcreteState1
ConcreteState2
+handle()
Client
Context
«interface»
Strategy
:
:
«interface»
AbstractExpression
Context
Strategy
Interpreter
+execute()
:
:
+interpret()
,
+handle()
,
-
.
,
,
TerminalExpression
NonterminalExpression
+interpret() : Context
+interpret() : Context
.
.
ConcreteStrategyA
ConcreteStrategyB
+execute()
+execute()
Client
«interface»
Aggregate
+createIterator()
«interface»
Iterator
AbstractClass
Template method
Iterator
+templateMethod()
#subMethod()
:
:
:
:
+next()
,
-
.
-
,
,
.
ConcreteAggregate
+createIterator() : Context
Mediator
+subMethod()
+next() : Context
«interface»
Colleague
Mediator
«interface»
Visitor
Visitor
Client
+visitElementA(in a : ConcreteElementA)
+visitElementB(in b : ConcreteElementB)
:
:
:
:
«interface»
Element
,
,
ConcreteVisitor
.
.
,
ConcreteMediator
ConcreteClass
.
ConcreteIterator
+accept(in v : Visitor)
+visitElementA(in a : ConcreteElementA)
+visitElementB(in b : ConcreteElementB)
ConcreteColleague
.
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
Vlad.Lastname
http://www.habrahabr.ru/
,
ConcreteElementA
.
+accept(in v : Visitor)
ConcreteElementB
+accept(in v : Visitor)
«interface»
Adapter
Client
Client
+operation()
Proxy
Adapter
:
«interface»
Subject
:
:
:
+request()
,
ConcreteAdapter
.
Adaptee
-adaptee
+adaptedOperation()
+operation()
.
.
RealSubject
Proxy
+request()
+request()
Abstraction
Client
+operation()
«interface»
Implementor
Abstract factory
Bridge
«interface»
AbstractFactory
:
:
+operationImpl()
:
«interface»
AbstractProduct
+createProductA()
+createProductB()
:
,
.
,
.
ConcreteImplementorA
ConcreteFactory
ConcreteImplementorB
+operationImpl()
ConcreteProduct
+createProductA()
+createProductB()
+operationImpl()
«interface»
Component
«interface»
Builder
Director
Composite
+operation()
+add(in c : Composite)
+remove(in c : Composite)
+getChild(in i : int)
Builder
:
+construct()
+buildPart()
:
:
:
,
.
-
,
ConcreteBuilder
Composite
Leaf
,
+operation()
+add(in c : Composite)
+remove(in c : Composite)
+getChild(in i : int)
+operation()
«interface»
Component
.
+buildPart()
+getResult()
.
ConcreteComponent
+operation()
+operation()
Decorator
:
Creator
«interface»
Product
Factory method
+factoryMethod()
+anOperation()
:
:
Decorator
:
+operation()
.
,
,
ConcreteDecorator
.
.
-addedState
ConcreteCreator
ConcreteProduct
+factoryMethod()
.
+operation()
+addedBehavior()
Client
Facade
Facade
Prototype
:
«interface»
Prototype
:
:
+clone()
:
.
,
-
-
,
,
.
FlyweightFactory
«interface»
Flyweight
+getFlyweight(in key)
+operation(in extrinsicState)
.
Flyweight
,
Client
+operation(in extrinsicState)
Singleton
:
:
-intrinsicState
ConcretePrototype2
+clone()
Singleton
:
.
ConcreteFlyweight
ConcretePrototype1
+clone()
:
-static uniqueInstance
-singletonData
,
.
+static instance()
+SingletonOperation()
UnsharedConcreteFlyweight
-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
Vlad.Lastname
http://www.habrahabr.ru/
Скачать