What would be relationship and relational template in the contexts below (removed here )?
Context 1:
Double-dispatch
Maniero: I agree and think [the lack of double-dispatch support or the view that double-dispatch must be applied] one of the biggest problems of the whole mechanism . Enough to disqualify where it should not.
It is too abstract an example for me to say, but it is very common that this problem arises when trying to model something that does not really exist, when trying to use OOP where it does not fit, maybe a relationship would be more suitable.
My perception is that this occurs too much in the use of OOP.
Here comes the problem that I say, the person gets so blind in using OOP for everything she can ignore that she has the easiest means to solve the problem. The relational model is often easier for people to understand.
EDIT 1: @prmottajr's (deleted) response almost killed the issue by citing relationship between entities and reminding me that the relationship might be referring to associations in domain model. But the question actually wants to know how the terms apply in the contexts cited, so it takes a bit more detail. In the case of the above context, what I'm not clear about would be an association like this in the class diagram and how this would translate into code.
Context 2:
Simple implementation inheritance
Victor: Inheritance can almost always be replaced by composition. An object in memory consists of several fields that correspond to other objects (or to primitive / built-in values). For example, an object of class
Veiculo
would be represented by a data sequenceplaca
,proprietário
,tipo-de-combustível
. An object of typeCarro
(subclass ofVeiculo
) would be represented byplaca
,proprietário
,tipo-de-combustível
,cor
,modelo
,marca
. Note that this is almost equivalent to having the subclass structure beVeiculo
,cor
,modelo
,marca
. That is, by using composition in place of inheritance, you come up with a structure with the same data, but the is more flexible as to what it can encapsulate from the superclass and how.Maniero: I agree 100%, especially the last sentence of the 1st paragraph. And this is a relational model and modular rather than OO.
EDIT 2: I understood that we are talking about composition, which is a type of association, and that the word "subclass" I just blacked out in the above quote would actually be "composition." What we need to understand is:
a) The example is illustrative only, we are not recommending modeling where a car is made up of a vehicle, is it? (Obviously not, I guess I should not even be asking this, but it's just to make it clear);
b) in OOA & D there is the conceptual class diagram and class diagram of the project. When we say "Car contains Vehicle" we are in the conceptual and when we say "Car inherits from Vehicle" or "Car is composed of Vehicle" we are in the project. How much we are in the conceptual makes sense then the statement that it is a relational model and that this is not OO. Already in the project we are mapping from the conceptual to the OO and in this case I think it does not make sense to make this statement. Am I right? In this case I did not understand the impact of this statement, ie the impact of "" and this is a relational model and not OO ".
I also have doubts as to why it is a modular model, but I think it's best to leave it to another question so that it does not fall outside the scope of this, unless the answer is simple.
PS: I apologize for my writing style being very convolute, after a while without reading the question you can see it.