home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.object
- Path: sparky!uunet!rational.com!thor!rmartin
- From: rmartin@thor.Rational.COM (Bob Martin)
- Subject: Re: Booch question: new class relationship?
- Message-ID: <rmartin.727740331@thor>
- Sender: news@rational.com
- Organization: Rational
- References: <894@ulogic.UUCP>
- Date: Fri, 22 Jan 1993 22:05:31 GMT
- Lines: 67
-
- hartman@ulogic.UUCP (Richard M. Hartman) writes:
-
- >I have a question here. I have been thinking about class
- >relationships and I think I've come up w/ one that is not
- >distinguished in the Booch method.
-
- >Comments? Am I imagining a difference that makes no difference? Has
- >someone brought this difference up before? Is it represented in some
- >OO Design methodology somewhere?
-
- You can mail a letter to prod_info@rational.com asking them for
- Booch's latest paper on the notation. In that paper you will find
- what you are looking for.
-
- The "using" relationships described in his book have been replaced
- with:
-
- Contains by Value
- Which is a black circle, a double line and a black box
-
- *=========#
-
- Contains by Reference
- A black circle, double line and a white box
-
- *=========[]
-
- Uses
- A white circle, double line and no box.
-
- O=============
-
- Containment by value represents the notion that the storage of the
- contained class exists within the storage of the containing class.
- The containing class has intrinsic knowledge of the contained class
- (ie. knows where to find it). The contained class is created and
- destroyed with the containing class. The contained class cannot be
- polymorphic.
-
- class ContainingByValue
- {
- Contained x;
- };
-
- Containment by reference denots that the containing class contains a
- pointer or reference to the contained class. Such containment can be
- polymorhpic, but does not dictate that the lifetimes of the contained
- and containing objects are the same.
-
- Class ContainingByReference
- {
- Contained* x;
- };
-
- Uses is a weak relatioship which means that the using class uses the
- used class in its interface somewhere.
-
- Class Uses
- {
- void f(const Used& u);
- };
-
- --
- Robert Martin | Design Consulting | Training courses offered:
- R. C. M. Consulting | rmartin@rational.com | Object Oriented Analysis
- 2080 Cranbrook Rd. | Tel: (708) 918-1004 | Object Oriented Design
- Green Oaks, Il 60048| Fax: (708) 918-1023 | C++
-