You don't really have to do anything! :)  

But to answer the question: In your example, you might have a mammal.  Then
a cat is a special kind of mammal - so the mammal->cat is a specialisation,
or sub-class type relationship (extends parent).

The collar, on the other hand, is not a special kind of cat.  A cat may have
a collar.  This is an object-level relationship (collaboration).  I would
call this an "association" because both cat and collar can exist by
themselves.  You might have methods in each so that the objects can talk to
each other.  You might make the association through some intermediate
transaction object to represent the cat "wearing" the collar... But that's
for another day....

A leather collar is a special kind of collar, so this is another
specialisation (sub-class/extension).

As for cow... What the?  You might associate a "leather" object with a
particular "cow" if you really needed to know where a piece of leather came
from... But then again, the cow's dead so I'm sure no one really cares!
Being completely abstract, this might be some form of association - but in
the real world, you have to have some kind of reason to associate two
things, I can't see a reason here.

In your original example, it's probably more correct to introduce some more
objects.  You might give a "person" a role such as "customer" (as opposed to
"administrator").  You would probably create a "shopping transaction" which
facilitates a person/role interacting with a "shopping cart" through "items"
(stores the items, has a sub-total, etc).  The shopping cart knows what
functions it can do, but perhaps isn't the best place to keep track of what
a particular person is doing.

A lot of object modeling is to do with personal choice, and what the
application is really trying to accomplish.  I completely recommend
"Streamlined Object Modeling" (Nicola, Mayfield, Abney).  I just finished it
and it's a damn good book.  But only some of it can really be appropriately
applied to traditional CFMX, as Gary suggested.

Nathan.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Scott Barnes
Sent: Tuesday, 21 January 2003 4:53 PM
To: CFAussie Mailing List
Subject: [cfaussie] Re: CFC Development


Q. In OOP do objects HAVE to have cascading relationship

ie.

Mammal --> cat --> collar --> leather --> cow

Scott.




---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to