Strategy pattern
Upcoming SlideShare
Loading in...5
×
 

Strategy pattern

on

  • 344 views

 

Statistics

Views

Total Views
344
Views on SlideShare
344
Embed Views
0

Actions

Likes
0
Downloads
8
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Strategy pattern Strategy pattern Presentation Transcript

  • Strategy Pattern
    Albert Guo
    junyuo@gmail.com
  • Motivation
    Intent
    Implementation
    Applicability & Examples
    2
    Agenda
  • There are common situations when classes differ only in their behavior. For this cases is a good idea to isolate the algorithms in separate classes in order to have the ability to select different algorithms at runtime.
    Motivation
    3
  • Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
    4
    Intent
  • 5
    Implementation
  • 6
    Implementation – cont.
  • Applicability & Examples
    7
  • 8
    Applicability & Examples – cont.
  • 9
    Applicability & Examples – cont.
  • 10
    Applicability & Examples – cont.