I'm working on a personal project manipulating list of bets and odds in sport games. So I've got a sport->event->match->bet->odd hierarchy to handle.
I'm trying to do it, also as an exercise as I'm quite new to those concepts, in respect of the rules described in Teresko's answer in his great post here under :
How should a model be structured in MVC? (To sum up, his answers explains that the model layer of an MVC app is usually made of Domain objects, data mappers and services)
One of the functionalities that I'll need is to generate a list of the matches of the day, showing as well some datas of the sports and events they're attached to as well as bets and odds attached to them.
And I can't figure out yet how to correctly design that hierarchy. My current idea is to assume that sports, events, matchs, etc aka the nodes of my hierarchy tree are all domain objects and will have their associated data mapper. My hierarchy, would be a Domain Object as well, that would handle infos about the tree structure, and have it's own dataMapper. That dataMapper would realize transversal fetching jobs like returning the matches of the day. That would in the end be a big join on the different tables and attributes that the 5 different nodes data mappers (one for sport, one for event, etc) would provide him.
I really feel like I'm missing something here and that this is not the way to go. But that kind of organization sounds quite common so I was hoping that you guys may know about some usual and elegant way of handling this.
thanks in advance,
Wish you all a pleasant day.