The Nature Of Patterns

472 views

Published on

Overview of patterns and specific details of the strategy pattern

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
472
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

The Nature Of Patterns

  1. 1. The Nature of Patterns<br />A Strategy Moving Forward<br />
  2. 2. Why Patterns<br />Encapsulates Best Practices and Lessons Learned <br />Reusable Solutions to Recurring Problems<br />Forms a Vocabulary for Describing Architecture<br />
  3. 3. What is Wrong With Patterns<br />Often Not Well Understood<br />Often Misused<br />Often Causes Confusion Instead of Clarity<br />Once Done Poorly Everyone is Inclined to Avoid Future Opportunities<br />
  4. 4. Steps for Using Patterns Effectively<br />Refactor To Patterns<br />Refactor Towards Patterns<br />Refactor From Patterns<br />TRAIN TRAINTRAINTRAIN<br />Study Patterns in Context<br />Study Patterns Outside of a Project Before Using<br />
  5. 5. Strategy Pattern<br />Encapsulate Related Algorithms Behind a Common Interface<br />Multiple Types Implement the Common Interface<br />Switch Implementations by Switching Types<br />Because Each Type Implements the Common Interface, Each Type can be Treated the Same<br />
  6. 6. Sample Strategies<br />Plug-ins<br />Provider Patterns<br />Amortization Schedules in a Mortgage Calculator<br />Multiple Views to a Single Presenter<br />State Object for State Specific Business Logic Logic<br />
  7. 7. Strategy Code<br />Password Complexity Validation<br />Each Class Will Define a Validation Test<br />Driver Process Will Loop Through the Configured Tests and Evaluate the Results<br />
  8. 8. Code Demo<br />

×