1 / 9

# STRATEGY - PowerPoint PPT Presentation

STRATEGY. Object Behavioral Pattern. You are at the Pub two weeks before Fall Formal and still don’t have a date! All of a sudden a girl who you had a crush on during o-week walks in.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about ' STRATEGY' - cody-duffy

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### STRATEGY

Object Behavioral Pattern

You are at the Pub two weeks before Fall Formal and still don’t 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)

How you doin? don’t have a date! All of a sudden a girl who you had a crush on during o-week walks in

Intent of Strategy around the room again?

• 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

When is Strategy used? around the room again?

• When many related classes differ only in their behavior

• Different variants of an algorithm exist in order to reflect different space/time trade-offs

Structure around the room again?

Airline Ticket Reservations around the room again?

• 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.

Airline Ticket Reservations around the room again?