Re: Some really confusing things about parent-child relationship
Date: Thu, 16 Aug 2007 07:26:51 -0000
On 14 aug, 20:15, beginner16 <kaja_love..._at_yahoo.com> wrote:
> I would really need some help with the following questions. And
> apologies for so many of them
> In hierarchical model parent class can have several subclasses. What
> does that mean exactly?
> That an instance A of parent class can have connections to several
> instances of certain subclass, or that an instance A can have
> connections to two or more instances, where each instance is of
> different subclass type, or both?
> And why do we name some classes subclasses and other classes
> It makes sense in object oriented programs, but here subclass doesn't
> necessarily suggests more specialized version of parent class.
> As far as I understand it, in hierarchical model we get a parent
> child relationship by simply creating a connection between two
Indeed. The term subclass is here used in a very different meaning than in OO. Here it expresses something similar to containment. As in: the engine is part of the car so Engine is a subclass of Car.
> My book only briefly talks about network model, so some of the
> information on the subject is very ambiguous. For example:
> with network model child classes can have several parent classes -->
> do we call this a M:N connection, or does M:N connection only mean
> that an instance of certain child class is connected to several
> instances of certain parent class and vice versa
> Anyhow, book divides network model in three parts:
> * simple network model --> M:N connections are not allowed
> * complex network model --> M:N connections are allowed
> * limited network model
> Are in all three cases situations allowed where a child can have
> several parents?
Yes. But in the simple network model if you have a parent class A and a child class B then either every parent in A has at most one child in B or vice versa.
> Now how do we know which of the two connected entity types is a
> parent and which a child and why does it matter?
It doesn't. It's an artifact of the way this model was implemented usually.
> Next comes the mother of all confusing statements:
> book starts claiming that between the two entity types there can be
> several 1:N connection ( meaning just 1:N connections ... M:N
> connections ).
> Huh, didn't it previously claimed that complex network model allows
> M:N connections?
Hard to say without more context. Of course, saying that there can be several 1:N relationships doesn't exclude that there may also be several N:M relationships.
- Jan Hidders