Upgrade to Pro — share decks privately, control downloads, hide ads and more …

An Introduction to Design Patterns

Austin Morris
September 11, 2013

An Introduction to Design Patterns

An introduction to design patters. What they are and why they are important.

Austin Morris

September 11, 2013
Tweet

More Decks by Austin Morris

Other Decks in Design

Transcript

  1. 1.) Repeated problem 2.) Reusable solution 3.) Name 4.) Set

    of consequences What is a design pattern?
  2. Because you don’t remember that thing you did that one

    time when the other stuff didn’t work. Why do we use design patterns?
  3. • Abstract Factory • Builder • Factory Method • Prototype

    • Singleton • Adapter • Bridge • Composite • Decorator • Facade • Flyweight • Proxy • Chain of Responsibility • Command • Interpreter • Iterator • Mediator • Memento • Observer • State • Strategy • Template Method • Visitor
  4. (All the design patterns I could find in ten minutes

    plus the time it took to type them.) Now:
  5. Abstract Client, Abstract Factory, Abstract Server, Action, Active Object, Active

    Record, Adapter, Application Controller, Association Table Mapping, Balking, Binding Properties, Bridge, Builder, Caretaker, Chain Of Responsibility, Class Table Inheritance, Client Session State, Coarse-Grained Lock, Concrete Table Inheritance, Command, Composite, Cursor, Data Bus, Data Mapper, Data Transfer Object, Database Session State, Decorator, Dependent Mapping, Dependents, Disable Job Request While Running Job, Domain Model, Double Checked Locking, Dynamic User Interface, Embedded Value, Event Based Asynchronous, Facade, Facet, Factory Method, Flyweight, Foreign Key Mapping, Front Controller, Gateway, Guarded Suspension, Handle Body, Hierarchical Visitor, Identity Field, Identity Map, Implicit Lock, Inheritance Mappers, Interface Segregation Principle, Interpreter, Iterator, Join, Kit, Layer Supertype, Lazy Instantiation, Lazy Load, Lock, Mapper, Mediator, Memento, Messaging, Metadata Mapping, Mock Object, Model View Controller, Module, Money, Monitor, Monostate, Multiton, Null Object, Object Pool, Observer, Optimistic Offline Lock, Page Controller, Pessimistic Offline Lock, Plugin, Policy, Prototype, Proxy, Publish Subscribe, Pub Sub, Query Object, Reactor, Read Write Lock, Record Set, Registry, Remote Facade, Repository, Resource Acquisition is Initialization, Row Data Gateway, Scheduled Task, Scheduler, Separated Interface, Serialized Large Object, Server Session State, Servant, Service Layer, Service Locator, Service Stub, Single Table Inheritance, Singleton, Special Case, Specification, State, States, Static User Interface, Strategy, Surrogate, Table Data Gateway, Table Module, Template Method, Template View, Thread Pool, Thread Specific Storage, Token, Transaction, Transaction Script, Transfold, Transform View, Translator, Two Step View, Unit of Work, Value Object, Virtual Constructor, Visitor, Wrapper
  6. “... abstract the instantiation process... make a system independent of

    how its objects are created, composed, and represented.” Creational
  7. • Abstract Factory • Builder • Factory Method • Prototype

    • Singleton • Adapter • Bridge • Composite • Decorator • Facade • Flyweight • Proxy • Chain of Responsibility • Command • Interpreter • Iterator • Mediator • Memento • Observer • State • Strategy • Template Method • Visitor
  8. • Abstract Factory • Builder • Factory Method • Prototype

    • Singleton • Adapter • Bridge • Composite • Decorator • Facade • Flyweight • Proxy • Chain of Responsibility • Command • Interpreter • Iterator • Mediator • Memento • Observer • State • Strategy • Template Method • Visitor
  9. “...concerned with algorithms and the assignment of responsibility between objects…

    shift focus of flow of control to the way objects are interconnected.” Behavioral
  10. • Abstract Factory • Builder • Factory Method • Prototype

    • Singleton • Adapter • Bridge • Composite • Decorator • Facade • Flyweight • Proxy • Chain of Responsibility • Command • Interpreter • Iterator • Mediator • Memento • Observer • State • Strategy • Template Method • Visitor
  11. Abstract Factory - use an interface to create objects. The

    type is determined at runtime. “Program to an interface, not an implementation.”
  12. Adapter - convert an existing interface into one that a

    client expects. “Program to an interface, not an implementation.”
  13. Template Method - Define a skeleton algorithm that subclasses implement.

    “Program to an interface, not an implementation.”
  14. Strategy - an object has a variable behavior. “Favor object

    composition over class inheritance.”
  15. Abstract Client, Abstract Factory, Abstract Server, Action, Active Object, Active

    Record, Adapter, Application Controller, Association Table Mapping, Balking, Binding Properties, Bridge, Builder, Caretaker, Chain Of Responsibility, Class Table Inheritance, Client Session State, Coarse-Grained Lock, Concrete Table Inheritance, Command, Composite, Cursor, Data Bus, Data Mapper, Data Transfer Object, Database Session State, Decorator, Dependent Mapping, Dependents, Disable Job Request While Running Job, Domain Model, Double Checked Locking, Dynamic User Interface, Embedded Value, Event Based Asynchronous, Facade, Facet, Factory Method, Flyweight, Foreign Key Mapping, Front Controller, Gateway, Guarded Suspension, Handle Body, Hierarchical Visitor, Identity Field, Identity Map, Implicit Lock, Inheritance Mappers, Interface Segregation Principle, Interpreter, Iterator, Join, Kit, Layer Supertype, Lazy Instantiation, Lazy Load, Lock, Mapper, Mediator, Memento, Messaging, Metadata Mapping, Mock Object, Model View Controller, Module, Money, Monitor, Monostate, Multiton, Null Object, Object Pool, Observer, Optimistic Offline Lock, Page Controller, Pessimistic Offline Lock, Plugin, Policy, Prototype, Proxy, Publish Subscribe, Pub Sub, Query Object, Reactor, Read Write Lock, Record Set, Registry, Remote Facade, Repository, Resource Acquisition is Initialization, Row Data Gateway, Scheduled Task, Scheduler, Separated Interface, Serialized Large Object, Server Session State, Servant, Service Layer, Service Locator, Service Stub, Single Table Inheritance, Singleton, Special Case, Specification, State, States, Static User Interface, Strategy, Surrogate, Table Data Gateway, Table Module, Template Method, Template View, Thread Pool, Thread Specific Storage, Token, Transaction, Transaction Script, Transfold, Transform View, Translator, Two Step View, Unit of Work, Value Object, Virtual Constructor, Visitor, Wrapper
  16. Austin’s Opinion: Mandatory reading for anybody who wants to write

    great software. Talks about patterns for domain modeling.
  17. Austin’s Opinion: Optional reading - If you are already using

    a good framework/ORM, you are already using most of these patterns.