Your SlideShare is downloading. ×
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
How I Learned To Apply Design Patterns
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

How I Learned To Apply Design Patterns

8,079

Published on

A presentation on how I learned to apply design patterns in software development and the additional principles/guidelines that helped along the way.

A presentation on how I learned to apply design patterns in software development and the additional principles/guidelines that helped along the way.

1 Comment
6 Likes
Statistics
Notes
No Downloads
Views
Total Views
8,079
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
180
Comments
1
Likes
6
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. How I Learned To Apply Design Patterns
    Andy Maleh
    Obtiva Corp.
  • 2. Outline
    What Are Design Patterns?
    Gang of Four Design Patterns
    GRASP Patterns
    Learning Process
    Example
  • 3. What Are Design Patterns?
    Reusable solutions to common problems encountered at the software design level of abstraction.
    A pattern usually consists of:
    Name
    Problem
    Solution
    Consequences
  • 4. Gang of Four Design Patterns
    Strategy
    State
    Decorator
    Proxy
    Abstract Factory
    Factory Method
    Chain of Responsibility
    Visitor???
  • 5. GRASP Patterns
    General Responsibility Assignment Software Patterns
    Appeared in the book "Applying UML and Patterns" by Craig Larman
    Provide the underpinnings of Object Oriented Design
    Help explain the benefits of most Gang of Four design patterns as well as how they were arrived to
    Contemplated collectively instead of one at a time
  • 6. GRASP Patterns
    Creator
    Information Expert
    Controller
    Low Coupling
    High Cohesion
    Polymorphism
    Pure Fabrication
    Indirection
    Protected Variations
  • 7. Learning Process
    Study design patterns with genuine interest to deeply understand them and recognize when applying them would reap benefits in real-world scenarios.
    Look for every opportunity to apply them to slowly develop a sense of smell for when patterns can be applied.
    Learn to recognize when a design pattern is absolutely necessary and helpful and when it is just over-engineering.
  • 8. Example – Order Submission
    Requirements:
    When an order is first created, it is not ready for on-line submission as it is missing required information.
    An order becomes ready for submission once filled in with required information.
    A pending order is an order that was interrupted amidst on-line submission.
    Once an order is submitted, it cannot be edited and resubmitted.
  • 9. Example – Order Submission
    Order State Diagram:
  • 10. Example – Order Submission
    Applications:
    Each order state is represented with a state object
    Not Ready
    Ready
    Pending
    Submitted
    View observes order to update edit and submit button enablements
  • 11. Example – Order Submission
    Design Patterns:
    State
    Observer
  • 12. Example – Order Submission
    GRASP Patterns:
    Polymorphism
    Order States handling behaviorpolymorphically
    Indirection
    Observers provide indirect coupling to order state
    Protected Variations
    Order is protected from state variations
    Low Coupling
    Order has low coupling to behavior variation per state
    View has low coupling to Order via observers
  • 13. Example – Order Submission
    Benefits:
    Order behaviorvariation across states is clarified
    Order behavior is easily maintainablein different classes
    No complicated if/else conditionals
  • 14. Review
    What Are Design Patterns?
    Gang of Four Design Patterns
    GRASP Patterns
    Learning Process
    Example
  • 15. ???
  • 16. References
    Design Patterns: Elements of Reusable Object-Oriented Software
    Authors: Gang of Four
    ISBN-13: 978-0201633610
    Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development
    Author: Craig Larman
    ISBN-13: 978-0131489066
    Recommended Chapters (17, 25, 26)
    Object Design: Roles, Responsibilities, and Collaborations
    Author: Rebecca Wirfs-Brock
    ISBN-13: 978-0201379433
  • 17. Contact
    Presenter: Andy Maleh
    Email: andy at obtiva dot com
    Twitter: AndyMaleh
    Blog: http://andymaleh.blogspot.com

×