1 / 16

Design Patterns

Design Patterns. 1 Paradigm. 4 Concepts. 9 Principles. 23 Patterns. 1 Paradigm. Object-Orientation is good!. Not every-body agrees…. 4 Concepts. The foundations of Object-Orientation Abstraction Encapsulation Inheritance Polymorphism. 9 Principles.

rogan-sharp
Download Presentation

Design Patterns

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Design Patterns

  2. 1 Paradigm 4 Concepts 9 Principles 23 Patterns

  3. 1 Paradigm Object-Orientation is good! Not every-body agrees…

  4. 4 Concepts • The foundations of Object-Orientation • Abstraction • Encapsulation • Inheritance • Polymorphism

  5. 9 Principles • Just knowing the four concepts does not make you a good software designer… • Provide no guidance to design decisions • Concepts are made operational through a set of of principles for good Object-Oriented design

  6. 9 Principles • Isolate the aspects of your application that vary • Program to an interface, not an implementation • Favor composition over inheritance • Strive for loosely coupled designs between interacting objects • Classes should be open for extension, but closed for modification • Depend upon abstractions, not upon concrete classes • Principle of Least Knowledge – only talk to your closest friends • The Hollywood principle – don’t call us, we’ll call you • A class should only have one reason to change

  7. 9 Principles • Where do the principles come from…? • Accumulated wisdom, learned from solving real-life design problems • Some obvious… • Some not-so-obvious… • Some overlapping…

  8. 9 Principles • Principles can be used operationally when designing; as guidelines and sanity check • What problems are we solving when designing software…? • Examined by the ”Gang of Four” in the 90’es • Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides

  9. 23 Patterns • Authors examined a large base of high-quality code, to identify how common software design problems were solved • No theoretical work; pattens are discovered, not invented • 23 common strategies for solving design problems were identified, and dubbed design patterns

  10. 23 Patterns • Design patterns fall in three categories • Creational: How are objects created • Structural: How are objects combined • Behavioral: How do objects interact

  11. 23 Patterns • Creational patterns • Singleton • Prototype • Builder • Factory Method • Abstract Factory

  12. 23 Patterns • Structural patterns • Adapter • Bridge • Composite • Decorator • Facade • Flyweight • Proxy

  13. 23 Patterns • Behavioral patterns • Chain of responsibility • Command • Interpreter • Iterator • Mediator • Memento • Observer • State • Strategy • Template Method • Visitor

  14. Design Patterns • Are distilled knowledge • Learned from practical experience • Solve a problem in a given context • Provides a common vocabulary • Is not the solution to all SW design issues… • …but almost 

More Related