Your SlideShare is downloading. ×
Hw8 GoF state, strategy, tempate method, visitor
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

Hw8 GoF state, strategy, tempate method, visitor

140

Published on

GoF Patterns: State, Strategy, Template Method and Visitor

GoF Patterns: State, Strategy, Template Method and Visitor

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
140
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
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. UTAH STATE UNIVERSITY COMPUTER SCIENCE CS-7350 Reading Assignment GoF Patterns: State, Strategy, Template Method and Visitor Jorge Edison Lascano Spring 2012 01-27-2012STATE, STRATEGY, TEMPLATE METHOD and VISITORGoF PATTERNSState, is it really easy to add new states?It is not easy, since ConcreteState objectsbehavior depends on each other, in this sense, thecomplexity of selecting the subsequent state is sparsed among all objects (the intelligence isdistributed). If we need to model this behavior, a Multi Object State Machine Diagram will beneeded, and it can become a very complex task if more states are needed.Besides,if transitionsare not controlled by some component, certain kind of anarchy may occur. As ConcreteStates aresupposed to work as a team, Observer pattern could be a possible solution that allows notifyingwhen object changed its state or a new object appears, aflag can be used to indicate the activestate in time, it is still not easy to increase states though, but its collaborative behavior is bettercontrolled.In Strategy, the client still has to take the decision on which object to use. Template Method, isdifficult to maintain when ConcreteClasses are increased and worse if levels of hierarchy areadded. Visitor, is a wrapper with special permissions that breaks some encapsulation of thevisitees.

×