1 / 15

Object-Oriented Design Patterns

Object-Oriented Design Patterns. All about me. Lee Brandt – Gemini Blog: http://www.codebucket.org Shout Outs: Geeks With Blogs http://www.geekswithblogs.net Dot Net User’s Group http://www.kcdotnet.com http://groups.google.com/group/kcdotnet. Agenda. What Design Patterns are

clay
Download Presentation

Object-Oriented 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. Object-Oriented Design Patterns

  2. All about me Lee Brandt – Gemini Blog: http://www.codebucket.org Shout Outs: Geeks With Blogs http://www.geekswithblogs.net Dot Net User’s Group http://www.kcdotnet.comhttp://groups.google.com/group/kcdotnet

  3. Agenda • What Design Patterns are • Why you should know them • The categories of Patterns • The Patterns themselves • Where you might (already) use them • When NOT to use a Design Pattern

  4. What Are Design Patterns? • Names for Commonly Solved Problems • Elements of Reusable OO Software • Gang of Four • Erich Gamma • Richard Helm • Ralph Johnson • John Vlissides • Code Complete • Steve McConnell • Patterns of Enterprise Architecture • Martin Fowler

  5. Why Should You Care? • Common Vocabulary • Discussing software design • Easy Understanding • Someone has already solved this problem • Proven Good Design • Understanding others’ code

  6. Get to the Patterns Fat Boy. • Pattern Categories • Creational • Structural • Behavioral • Pastoral • Pastoral-Comical • Historical-Pastoral • Tragical-Historical • Tragical-Comical-Historical…

  7. Creational Patterns • Factory Method • Used to create a concrete instance of a type • Abstract Factory • Creates Families of like objects • Builder • Used when an object can take multiple steps to instantiate • Prototype • Creates an object by “copying” itself from a base • Singleton • Ensures that only one instance of an object exists

  8. Structural Patterns • Adapter • Makes an object of one interface look like another interface for the consuming client • Bridge • Decouples an object’s interface from its implementation • Composite • A tree structure of simple and composite objects • Decorator • Add responsibilities to an object dynamically • Façade • Single class that simplifies access to an entire subsystem • Flyweight • A small instance managed by a list of state data • Proxy • An object that stands in for another object

  9. Behavioral Patterns • Chain of Responsibility • A way of passing a request between a chain of objects • Command • Encapsulate a command request as an object • Interpreter • A way to include language elements in a program • Iterator • Sequentially access the elements of a collection • Mediator • Defines simplified communication between classes

  10. Behavioral Patterns continued… • Memento • Capture and restore an object's internal state • Observer • A way of notifying change to a number of classes • State • Changes an object’s behavior when its state changes • Strategy • Encapsulates an algorithm inside a class • Template Method • Defer the exact steps of an algorithm to a subclass • Visitor • Defines a new operation to a class without change

  11. Adapter Pattern Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.

  12. You already use patterns • If you use: • .Net Framework • Iterator – GetEnumerator() • Composite – List • Strategy – IComparable • Observer – Event Handlers • Chain Of Responsibility – Event Handlers • WCF / Web Services • Proxy – Web Methods

  13. Continued… • Test-Driven or Behavior-Driven Development • Bridge – Mock Objects • Dependency Injection • Factory – DI Container • Bridge – Interface -> Implementation • MVC/MVP • Mediator – Presenter/Controller • Strategy – Presenter/Controller • Composite – View • Observer – Model

  14. For More Info • Reading • Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, et al. • Head First Design Patterns by Eric Freeman & Elisabeth Freeman • C# Design Patterns by James W. Cooper • Links • http://www.dofactory.com/Patterns/Patterns.aspx • http://c2.com/cgi/wiki?GangOfFour

  15. Questions??

More Related