home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / object / 5011 < prev    next >
Encoding:
Text File  |  1993-01-23  |  2.3 KB  |  79 lines

  1. Newsgroups: comp.object
  2. Path: sparky!uunet!rational.com!thor!rmartin
  3. From: rmartin@thor.Rational.COM (Bob Martin)
  4. Subject: Re: Booch question: new class relationship?
  5. Message-ID: <rmartin.727740331@thor>
  6. Sender: news@rational.com
  7. Organization: Rational
  8. References: <894@ulogic.UUCP>
  9. Date: Fri, 22 Jan 1993 22:05:31 GMT
  10. Lines: 67
  11.  
  12. hartman@ulogic.UUCP (Richard M. Hartman) writes:
  13.  
  14. >I have a question here.  I have been thinking about class
  15. >relationships and I think I've come up w/ one that is not
  16. >distinguished in the Booch method.
  17.  
  18. >Comments?  Am I imagining a difference that makes no difference?  Has
  19. >someone brought this difference up before?  Is it represented in some
  20. >OO Design methodology somewhere?
  21.  
  22. You can mail a letter to prod_info@rational.com asking them for
  23. Booch's latest paper on the notation.  In that paper you will find
  24. what you are looking for. 
  25.  
  26. The "using" relationships described in his book have been replaced
  27. with:
  28.  
  29.     Contains by Value
  30.         Which is a black circle, a double line and a black box
  31.  
  32.                 *=========#
  33.  
  34.     Contains by Reference
  35.         A black circle, double line and a white box
  36.  
  37.                 *=========[]
  38.  
  39.     Uses
  40.         A white circle, double line and no box.
  41.         
  42.         O=============
  43.  
  44. Containment by value represents the notion that the storage of the
  45. contained class exists within the storage of the containing class.
  46. The containing class has intrinsic knowledge of the contained class
  47. (ie. knows where to find it).  The contained class is created and
  48. destroyed with the containing class.  The contained class cannot be
  49. polymorphic.
  50.  
  51.     class ContainingByValue
  52.     {
  53.       Contained x;
  54.     };
  55.  
  56. Containment by reference denots that the containing class contains a
  57. pointer or reference to the contained class.  Such containment can be
  58. polymorhpic, but does not dictate that the lifetimes of the contained
  59. and containing objects are the same.
  60.  
  61.     Class ContainingByReference
  62.     {
  63.       Contained* x;
  64.     };
  65.  
  66. Uses is a weak relatioship which means that the using class uses the
  67. used class in its interface somewhere.
  68.  
  69.     Class Uses
  70.     {
  71.       void f(const Used& u);
  72.     };
  73.  
  74. --
  75. Robert Martin       | Design Consulting    | Training courses offered:
  76. R. C. M. Consulting | rmartin@rational.com |  Object Oriented Analysis
  77. 2080 Cranbrook Rd.  | Tel: (708) 918-1004  |  Object Oriented Design
  78. Green Oaks, Il 60048| Fax: (708) 918-1023  |  C++
  79.