Presentation is loading. Please wait.

Presentation is loading. Please wait.

Vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Idioms and Patterns polymorphism -- inheritance and delegation idioms -- realizing.

Similar presentations


Presentation on theme: "Vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Idioms and Patterns polymorphism -- inheritance and delegation idioms -- realizing."— Presentation transcript:

1 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Idioms and Patterns polymorphism -- inheritance and delegation idioms -- realizing concrete types patterns -- a catalogue of design patterns events -- the reactor pattern Additional keywords and phrases: generic types, assertions, canonical classes, event-driven computation

2 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie A catalogue of design patterns Subsections: Creational Patterns Structural Patterns Behavioral Patterns

3 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie A Catalogue of Design Patterns a common design vocabulary documentation and learning aid an adjunct to existing methods a target for redesign

4 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie The Pattern Schema Name - handle increases design vocabulary Problem - when to apply explains the problem and the conflict Solution - general arrangement design, responsibilities, collaborations Consequences - tradeoffs to understand the costs and benefits

5 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Causes for Redesign creating an object by specifying a class explicitly -- Abstract Factory, Factory Method, Prototype dependence on specific operations -- Chain of Responsibilty, Command dependence on hardware & software platforms -- Abstract Factory, Bridge dependence on object implementation or representation --Abstract Factory, Bridge, Memento, Proxy design for change

6 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie algorithm dependence -- Iterator, Strategy, Template Method, Visitor extending functionality by subclassing -- Bridge, Composite, Decorator, Observer tight coupling -- Abstract Factory, Bridge, Chain of Responsibilities, Command, Facade, Mediator, Observer inability to alter classes conveniently -- Adaptor, Decorator,

7 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Creational Patterns

8 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Creational Patterns Factory -- hide concrete classes Factory Method -- virtual constructors Prototype -- dynamic creation by cloning Singleton -- one instance only

9 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Structural Patterns Pattern Alias Remarks Composite part/whole collections of components Flyweight part/whole* extrinsic state, many objects Adaptor wrapper resolves inconsistencies Bridge handle/body abstraction to implementation Decorator wrapper to introduce functionality Facade wrapper* provides unified interface Proxy surrogate to defer... remote, virtual, protection object and class composition

10 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Behavioral Patterns cooperation algorithms and the assignment of responsibilities between objects class Template Method -- the skeleton of an algorithm Interpreter -- to evaluate expressions object composition Mediator -- provides indirection Chain of Responsibility -- connect objects to interact Observer -- to handle dependencies

11 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Encapsulating behavior Command -- action + undo Strategy -- choice of algorithms Visitor -- decouple traversal and operations Iterator -- access and traversal State -- object state -> behavioral change objectify!

12 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie The Observer Pattern Observer one-to-many dependencies and notification Consequences abstract coupling between subject and observer constraint propagation deals with unexpected updates

13 vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie


Download ppt "Vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Idioms and Patterns polymorphism -- inheritance and delegation idioms -- realizing."

Similar presentations


Ads by Google