I’m currently making a simple manager game/simulation to learn how to handle bigger projects.
As it is now, I have all my classes just in the /src folder created by Eclipse.
I feel that it would be a good idea to structure my project.
I have the following classes:
- Match
- TeamMatch
- Player
- PlayerFactory
- Team
- TeamFactory
- TeamSchedule
- Season
Now, one idea(and probably the right thing to do anyway!) would be to create Interface for matches, and have both Match and TeamMatch implement it. I think the logical follow up would be to have a folder named after the interface, and have the related classes inside.
But what about Player and PlayerFactory classes? Player has the basic info of a player, like age, name, etc. PlayerFactory creates Players as requested. But finding a common interface for these classes doesn’t seem likely! Same with TeamFactory. Maybe have all the factory classes grouped together?
Let’s look at the Team class. A team consists of players. Should these two be grouped together? A season has TeamSchedule, which has TeamMatches inside, which in turn has two teams.
This is one option I’m thinking about:
- src
- match
- Match
- TeamMatch
- factories
- PlayerFactory
- TeamFactory
- league
- Season
- Player
- Team
- TeamSchedule
- match
Any suggestions, blatant mistakes I’ve made or completely different views on the subject?
I would suggest:
create a base package which should have a name like
org.managergame.create three packages under the base package named
team,match,player.MatchandTeamMatchgo to the packagematch.PlayerandPlayerFactorygo to the packageplayer.Team,TeamFactoryandTeamSchedulego to the packageteam.Everything else can be under the base package.