samedi 14 juillet 2018

Golf game use visitor pattern, why is it a bad idea in this situation?

  • 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