OK, I have learnt a
concept and can't find a definitive agreement on the rioght words to use (try
googling and you'll find the same variations). What is the definitive language
for the following concepts:
Objects can
be built up from other objects (as opposed to inheriting them) - e.g. a
person can have address(es).
This can be
done in two ways
- tightly bound
where one is only ever considered in the context of being a child of the
other
- and loosely bound
where one has a life seperate from its parent.
Three comments often
made about tightly bound versus loosely bound:
- Tightly bound
often distinguished by fact that ending the life of the parent also ends the
life of the child
- Tightly bound
requires a multiplicity of 1 - a child in a tightly bound relationship cannot
have more than 1 parent.
- Tightly bound
often technically implemented by passing a collection of actual objects whereas
loosely bound is often technically implemented by passing references to the
objects.
Example of tightly
bound: a worm has sections (does anyone have a definitive real world example? I
was thinking Person:Address, but it's not always tightly
bound.)
Example of loosely
bound: a student attends classes (you don't delete all the classes just
because the kid drops out of college).
I get the concepts.
What I'm finding is that different authors seem to be using the three available
words (composition, association and aggregation)
differently.
So, Which of the
following is semantically correct:
(i) There are two
types of composition
- aggregation where
the child is only ever considered in the context of its
parent
-
and association where the child has a life seperate from its
parent
OR
(ii)There are two
types of association:
- composition where
the child is only ever considered in the context of its parent
- and aggregation
where the child has a life seperate from its
parent
It is of more than
casual interest, as it affects how you code the ORM in terms of cascading
deletes as well as influencing compiler garbage collection (which I am way less
interested in at the moment).
Definitive answers
greatly appreciated!
Best
Wishes,
Peter
----------------------------------------------------------Peter
You are subscribed to cfcdev. To unsubscribe, send an email to cfcdev@cfczone.org with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org