• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Patterns: state, strategy and visitor

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic