0
Good evening, I have some basic beginner questions
I need to create a timeline that has the following: What events occurred in a certain range of dates, who was born and who died in this range? I have the Person, Event and Timeline classes. My Timeline class is the one that determines the date range, so a data range has many events. With this logic I would have to create a class for Births and another for Deaths or can I create a single one to represent this with an attribute to differentiate and how would it be? As the relationship is Onetomany will be generated the tables Timeline_evento, Timeline_nascimento and Timeline_falecimento. If I do Manytoone the Event class will have to have the interval attribute, as well as the Birth and Death classes. Which of these solutions would be better?
Pessoa{ id name dtNascimento dtFalecement }
Event{ id title Description //Timeline? }
Timeline{ id Collection interval(events births deaths) addEvento(event) addNascimento(birth) addFalecimento(death) }
Nascimento{ id person //Timeline? }
Death{ id person //Timeline? }
//Only class with a distinguishing attribute Nomeclasse{ id person n/m //Timeline? }
EDIT:
I thought: If a Timeline class interval has a list of events, it will also have the list of deaths and births. So I would have to create these classes. The problem in this case is that if the relationship is Onetomany will be generated automatically plus three tables. If I do Manytoone the lists will not exist in the Timeline class that will only have the interval attribute and the Event, Birth and Death classes will have a Timeline attribute. The conclusion I’ve come to is that no matter what kind of relationship I choose I’ll have to take one or two classes to represent Births and Deaths
Example of how it should look in the view.