STRATEGY PowerPoint PPT Presentation

presentation player overlay
1 / 9
About This Presentation
Transcript and Presenter's Notes

Title: STRATEGY


1
STRATEGY
Object Behavioral Pattern
2
You are at the Pub two weeks before Fall Formal
and still dont have a date! All of a sudden a
girl who you had a crush on during o-week walks in
There are many different ways that you could
approach this situation. Each approach requires
a different methodology, but achieves the same
goal (i.e. you have confronted your crush)
3
How you doin?
4
Do you believe in love at first sight or should I
walk around the room again?
5
Intent of Strategy
  • Define a family of algorithms, encapsulate each
    one, and make them interchangeable
  • Strategy provides a common interface for all
    encapsulated algorithms and allows the algorithm
    to vary independently of the client

6
When is Strategy used?
  • When many related classes differ only in their
    behavior
  • Different variants of an algorithm exist in order
    to reflect different space/time trade-offs

7
Structure
8
Airline Ticket Reservations
  • There are many different ways to obtain an
    airline ticket. Depending on your utility for
    time and money, you may be looking for the
    cheapest flight available or you might want to
    find the quickest flight to your destination.

9
Airline Ticket Reservations
Write a Comment
User Comments (0)
About PowerShow.com