Monday, October 8, 2007

Visitor Pattern in Java

Visitor Pattern in Java

For example, suppose you have a hierarchy of Modem objects. The base class has the generic methods common to all modems. The derivatives represent the drivers for many different modem manufacturers and types. Suppose also that you have a requirement to add a new method, named configureForUnix, to the
hierarchy. This method will configure the modem to work with the UNIX operating system.

0 comments: