It has no problem to relate to more than one table at the same time, although in this case it is not at the same time, because it is conditional or relates to one or the other.
Data structure is not an algorithm, so the conditional is only in the concept, there is nothing to indicate this.
I cannot say if everything is correct because I do not know the requirements and they are in charge of what is right or wrong. Except for the salario
was float
that is certainly wrong.
I just disagree with Colaborador
be derived from Fisica
, Although this is almost lost, almost everyone thinks so, because the examples, wrong, of orientation to objects are always shown like this. Collaboration is just a role that a person plays in the model, it is not a relationship of is a to be inheritance. By the way almost every time you inherit from a concrete class is wrong, at least in domain modeling. Not that this is a golden rule for everyone, but it’s my perception after 30 years of doing this. Rare cases I’ve seen it work and yet it was always possible to inherit from abstractions instead of inheriting from concrete.
I haven’t looked at every aspect of the model.
I got it... so I thought I needed some different kind of relationship as some decision structure... I will also edit the salary type for Decimal I will try to understand better about this subject... !!!
– Thiago Prange
Here on the website is a lot of information about this. But if you don’t understand you’re using a mechanism you don’t understand, so the right thing to do is to learn more about it before using it, then make whatever decision you want, but because you want it not because you don’t understand it.
– Maniero