Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Domain Driven Design question

I would like to ask for a reccomended solution for this: We have a list of Competitions. Each competition has defined fee that a participatior has to pay We have Participators I have to know has a Participator that is on a Competition paid the fee or not. I am thinking about 2 solutions and the thing is it has to be the most appropriate solution in Domain Driven Design. First is to create a Dictionary in Competition instead of a List, the dictionary would have be of type <Participator, bool>. The secont is perhaps create a different class that has 2 fields, a participator and feePaid. And in Competiton I would have a list of object of that new class.

Thank you

like image 429
gljivar Avatar asked Dec 22 '22 13:12

gljivar


1 Answers

sounds like a typical many to many relationship. i would model it with an Entry association class as follows:

class Participator {
}
class Competition {
    Currency fee
}
class Entry {
    Competition competition
    Participator participator
    Boolean feePaid
}
like image 84
Ray Tayek Avatar answered Dec 27 '22 03:12

Ray Tayek