home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / object / 3411 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  2.4 KB

  1. Path: sparky!uunet!gatech!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsm!cbnewsl!att-out!pacbell.com!tandem!UB.com!igor!thor!rmartin
  2. From: rmartin@thor.Rational.COM (Bob Martin)
  3. Newsgroups: comp.object
  4. Subject: Re: Object-Oriented Methodologies - Class Specifications
  5. Message-ID: <rmartin.715531162@thor>
  6. Date: 3 Sep 92 14:39:22 GMT
  7. References: <715276480.1.p00058@mail.psi.net> <1992Sep1.220559.10346@m.cs.uiuc.edu>
  8. Sender: news@Rational.COM
  9. Lines: 42
  10.  
  11. johnson@m.cs.uiuc.edu (Ralph Johnson) writes:
  12.  
  13. |After examining an example of Rumbaugh's,
  14. |"Ronald C. Schultz" <p00058@mail.psi.net> writes:
  15.  
  16. |The class looks fine to me.  I can see where you
  17. |are coming from, since I have argued with Ed Berard on this point a
  18. |lot.  Basically, I think your assumption that a Circle shouldn't know
  19. |anything about a Line is mistaken.  You wouldn't want to make Circle
  20. |independent of Point, would you?  If you want to be able to intersect
  21. |geometric figures, and I claim that is *essential* to the meaning of
  22. |geometric figures, then you have to be able to compare one with another.
  23. |This means that you have to have something like intersectLine.
  24.  
  25. The problem here is one of context.  A circle, in and of itself,
  26. should not need to know anything about a Line.  However, if that
  27. Circle is part of a family of objects, all of which know how to find
  28. their intersection with a Line, then the knowledge of Line is an
  29. attribute of the family which is inherited by its members.  This is
  30. proper.
  31.  
  32. |I claim that you don't want to make a Circle class that is an independent
  33. |standalone entity.  The problem with small classes is that it takes too
  34. |much work to reuse them.  There is much bigger payoff when classes come
  35. |in families of similar classes, because then you can learn one class and
  36. |then just reuse your knowledge for all the other classes.  A Circle should
  37. |be part of a GeometricObject family of classes.  There will be a standard
  38. |set of operations that all the classes must implement, such as intersecting
  39. |with a point or another GeometricObject.  These classes will be designed
  40. |as a family and will probably be used as a family.  You are unlikely to use
  41. |a Circle in an application and not use a Line.  
  42.  
  43. Agreed.
  44.  
  45.  
  46.  
  47.  
  48. --
  49. Robert Martin                        Training courses offered in:
  50. R. C. M. Consulting                       Object Oriented Analysis
  51. 2080 Cranbrook Rd.                        Object Oriented Design
  52. Green Oaks, Il 60048 (708) 918-1004       C++
  53.