Sunday, November 20, 2011

OODesign - Design Pattern 4 (Behavioral Patterns)

Ref: http://www.oodesign.com/design-principles.html

Mediator Pattern
> Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.
(example: ...)


Memento Pattern
> The intent of this pattern is to capture the internal state of an object without violating encapsulation and thus providing a mean for restoring the object into initial state when needed.
(example: ManipulationImpl.as)
'

Observer Pattern
> Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
(example: Observe.as) (ref: http://opensource.adobe.com/wiki/display/cairngorm/HowToUseCairngormObserver, http://jacwright.com/373/as3-property-observer-implementation/)


Strategy
> Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

No comments:

Post a Comment