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

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

View Full Document Right Arrow Icon
Image of page 1

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

View Full Document Right 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.”
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.
Image of page 3

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

View Full Document Right Arrow Icon
Design Pattern
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.
Image of page 5

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

View Full Document Right Arrow Icon
Classifications Structural Creational Behavioral
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
Image of page 7

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

View Full Document Right 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
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
Image of page 9

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

View Full Document Right 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.
Image of page 10
Creational Patterns Prototype The Prototype pattern creates new objects by cloning one of a few stored prototypes.
Image of page 11

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern