1 / 20

Design Patterns

Design Patterns. Removing Pain From Design. Erik Peterson. Ducks!. Interfaces. Interface Segregation Principle. What about other birds?. Adapter Pattern. Wraps the interface of one class into an interface that can be used by a specific client. What the flock?.

kesler
Télécharger la présentation

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 Removing Pain From Design Erik Peterson

  2. Ducks!

  3. Interfaces Interface Segregation Principle

  4. What about other birds?

  5. Adapter Pattern Wraps the interface of one class into an interface that can be used by a specific client

  6. What the flock? Now we need a way to count all of these birds…

  7. DecoratorPattern Allows additional behavior to be added to a class dynamically

  8. How to build a duck • Now we have two types: • Quackable • Countable

  9. Factories Encapsulate object creation

  10. Abstract FactoryPattern Used to represent a group of factories that can create a common element

  11. About that flock… We need a way to go through the flock and check up on each bird, but how?

  12. IteratorPattern Encapsulates how to navigate an aggregate sequentially without exposing its internal structure

  13. Another way of changing behavior Different ducks behave in different ways Some might even migrate to different locales in the winter!

  14. Template MethodPattern Allows an inherited class to change the behavior on a base class by implementing an abstract (or virtual) method on the base

  15. Managing the Barn Our farmers want a way of easily managing the basic tasks around the barn… … introducing the Barn Automator 3000 Deluxe!

  16. CommandPattern Encapsulates requests, allowing the consumer to take in different types of commands

  17. Bringing Order to Chaos We now have a lot of birds, but how do we sort them?

  18. Strategy Pattern Encapsulates an algorithm away from a client so that they can be interchangeable

  19. Buy this book!

  20. Me: Erik Peterson cerikpete@gmail.com http://erikbase.blogspot.com Don’t Forget: Evaluations: http://codecamp.phillydotnet.org/2009-1/Lists/Code%20Camp%20Evaluation After party @ Shanachie in Ambler

More Related