Currently I am designing a Monopoly game using Java.
Each player in the game can own different properties. The issue I’m having is how to assign different property objects to each player. I have both a Player class and a Properties class. Would composition be the best way to go about doing this? If so, how would I do it?
I would add a new class PropertyManager.
This allows you to easily provide business rules in a single location (good separation of concerns) rather than having to dive through a bunch of player or property objects if you opt for composition in either. This will keep the Player and or Property classes from becoming weighed down with buying/selling business rules in the future.