#5 Design Patterns

#5 Design Patterns - DesignPattern It is a formal way of...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Design Pattern It is a formal way of documenting a solution to a design problem in a particular field of expertise. Introduced by Architect Christopher Alexander in the field of Architecture “ The elements of this language are entities called patterns. Each pattern describes a problem that occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice.”
Background image of page 2
Design Pattern In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Design Pattern
Background image of page 4
How Patterns are used? Design Problem. Solution. Implementation details. Reduce gap Design Implementation Designer Programmer Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design patterns: elements of reusable object-oriented software . 1995. Buschmann, F., Meunier, R., Rohnert, H., Sommerlad, P., Stal, M.: Pattern-oriented software architecture: a system of patterns . 2002.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Classifications Structural Creational Behavioral
Background image of page 6
Structural Structural patterns are concerned with how classes and objects are composed to form larger structures. Structural patterns can be employed while a system is being designed, or later on during maintenance and extension. Decorator Proxy Bridge Composite Flyweight Adapter Facade
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Purpose of Structural  Patterns Decorator Add new functionality dynamically to existing objects, or remove it Proxy Control access to an object Create expensive objects on demand Bridge Enable development of the interface and implementation of a component a proceed independently Select or switch implementations at runtime Adapter Match otherwise incompatible interfaces
Background image of page 8
Purpose of Structural  Patterns Flyweight Reduce the cost of working with large numbers of very small objects Facade Reorganize a system with many subsystems into identifiable layers with single entry point Simplify the interface to a complex subsystem Composite Treat single objects and composite objects in the same way
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Creational Patterns The creational patterns aim to separate a system from how its objects are created, composed, and represented. They increase the system’s flexibility in terms of the what, who, how, and when of object creation. Creational patterns encapsulate the knowledge about which classes a system uses, but they hide the details of how the instances of these classes are created and put together.
Background image of page 10
Creational Patterns Prototype The Prototype pattern creates new objects by cloning one of a few stored prototypes.
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/14/2011 for the course COMPUTER 091 taught by Professor Rajivsir during the Summer '11 term at MIT.

Page1 / 58

#5 Design Patterns - DesignPattern It is a formal way of...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online