I am trying to create an MVC application for managing sports teams and players using the Zend Framework. The team has a list of players, and each player belongs to only one team. The problem is creating several separate players.
At that moment when I create an instance of one player, a new team object is always created, even if I created an instance of a player belonging to the same team earlier. How could I avoid unnecessary multiple instances representing the same command? Is there any design pattern or technique that can be used here?
source share