Return to Home Page
      Blog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     FAQ      Search
 

Hi Bruce,
I am a great fan of all your work.
I learnt Java from you and it helped pay my rent.
Now I'm learning Python, maybe it'll pay my mortgage :).
Anyway, my question is on the Visitor pattern example.
You mention that the Flower hierarchy cannot change,
then how come you can add a method accept(Visitor)?
The way I am thinking of implementing Visitor/Visited, is have a corresponding visited hierarchy, VisitedFlower (decorator), which in turn has an accept(Visitor) method.
The Visitor methods remains the same visit(Flower1), visit(Flower2)..... VisitedFlower's accept method, will call
visitor.visit(decorated), where decorated is the Flower object.
Do you think my reasoning is correct?
Thanks much.
AMI

f  e  x



Add your comment below. Use an empty line between each paragraph. Paragraphs will be automatically formatted, and single carriage returns will be respected. Use <code> to begin a code block, and </code> to end a code block. Your email address will not be visible to spam harvesters or used in any way except to contact you with further questions.

Your Email Address:

Search     Home     WebLog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     Contact     Site Design     Server Maintenance     Powered by Zope
©2007 MindView, Inc.