- You are writing a golf game, and you are trying to simulate a ball rolling from point to point in the golf course.
- Your partner suggests that you use the
Visitor pattern
since the ball “visits” each point. - That way it can have different behavior for sand, a slight hill, the rough, a tree, water, etc.
- He likes the name
BallMovementVisitor
. Explain why this is a bad idea?
Aucun commentaire:
Enregistrer un commentaire