• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Patterns: state, strategy and visitor

 
Karthikraj Magapu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I was wondering if someone can explain the following patterns in their own words :
state
strategy
visitor
i understand the general idea of state and strategy but am very confused about visitor !
I am reading gof and the java companion for design patterns.
thanks in advance
karthik
 
Bagwan Mehrat
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I remember hearing that Visitor is not one of the patterns covered in SCEA Exam 1, and I don't remember seeing it in the exam, so you probably don't need to worry about it.
I also think the Visitor pattern is confusing, by the way, and I'm not if I would ever use it, because it makes the Visitor itself difficult to maintain (though it makes the Subject easier to maintain). The Visitor pattern allows you to add operations on classes without modifying those classes. You do this by adding "accept" methods in your classes, which perform a callback on your Visitor classes.
This still sounds confusing. I don't know if I really understand it myself.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic