mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 16:58:56 +00:00
Improved comments on visitor pattern example.
This commit is contained in:
@@ -2,10 +2,15 @@ package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* Visitor pattern defines mechanism to apply operations (UnitVisitor) on nodes
|
||||
* (Unit) in hierarchy. New operations can be added without altering the node
|
||||
* Visitor pattern defines mechanism to apply operations on nodes
|
||||
* in hierarchy. New operations can be added without altering the node
|
||||
* interface.
|
||||
*
|
||||
* In this example there is a unit hierarchy beginning from Commander.
|
||||
* This hierarchy is traversed by visitors. SoldierVisitor applies
|
||||
* its operation on Soldiers, SergeantVisitor on Sergeants and so
|
||||
* on.
|
||||
*
|
||||
*/
|
||||
public class App {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user