views:

65

answers:

1

I have been doing ASP.NET for many years and now playing catch up with MVC and DDD. I understand the majority of the concepts. I am re-developing a website which is for a sports website. Its essentially a CRUD style application but would like to DDD for learning and flexibility purposes. Have chosen not to do CQRS as that seems overkill although I can see the speed benefits. I follow a lot about Greg Young and others, but its got to the stage where the options are almost overwhelming and missing the point of trying to solve the problem.

The domain objects I have thought about are:

Season, Fixture, Team, Gamesheet, Competition, CompetitionRound, News, NewsCategory

Possible aggregates being:

  • Season

  • Fixture HAS HomeTeam

  • Fixture HAS AwayTeam
  • Fixture HAS Gamesheet
  • Fixture HAS List of CompetitionRound (could be league and cup game)
  • Fixture HAS Season
  • Fixture HAS News

  • News HAS NewsCategory

  • GameSheet HAS Fixture

  • Gallery HAS Fixture

Please note that fixture and gamesheet go both ways, is this right? I know it would work but is there a better way? I would need to display gamesheets on their own as well as fixtures. Otherwise I could just do FixtureRepo.GetBySeason(season).[0].Gamesheet etc..

Thanks in advance for any comments.

A: 

My worry is if I want to just get the gamesheets, if I dont get them directly so say something like GameSheetRepo.GetBySeason(season) I will have to do FixtureRepo.GetBySeason and then check to see if a gamesheet exists for each fixture... seems quite ineffiecent doing it that way. But I can't see anyway you can avoid then having bi-directional reference as a GameSheet needs to know its Fixture.. but at the sametime if I have a fixture I want to know if a gamesheet exists sometimes

Question is - does Fixtures makes sense w/o a GameSheet in Your model?

Should Fixtures be deleted when GameSheet is deleted?

If they do not and should be deleted - odds are that GameSheet is an aggregate root, it holds Fixtures, You don't need bi-directional association because You will never operate with fixture w/o GameSheet, Fixtures are created/modified/deleted through GameSheet only.

If GameSheet turns out to be an aggregate root but You need to display list of fixtures (that kind a asks to introduce bi-directional association), don't muddle Your model because of representation purposes only - just select GameSheets that got any Fixture`s, select them out, sort if necessary and display.


But filter out what I just said thoroughly.
It is really hard to help someone without knowing actual domain and I might misunderstood You completely.

Arnis L.
Fixture will come first. As the each season you would say 40 fixtures and as the season progresses you have a gamesheet added (once the fixture has been played and is a result)