home *** CD-ROM | disk | FTP | other *** search
- 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
- From: rmartin@thor.Rational.COM (Bob Martin)
- Newsgroups: comp.object
- Subject: Re: Object-Oriented Methodologies - Class Specifications
- Message-ID: <rmartin.715531162@thor>
- Date: 3 Sep 92 14:39:22 GMT
- References: <715276480.1.p00058@mail.psi.net> <1992Sep1.220559.10346@m.cs.uiuc.edu>
- Sender: news@Rational.COM
- Lines: 42
-
- johnson@m.cs.uiuc.edu (Ralph Johnson) writes:
-
- |After examining an example of Rumbaugh's,
- |"Ronald C. Schultz" <p00058@mail.psi.net> writes:
-
- |The class looks fine to me. I can see where you
- |are coming from, since I have argued with Ed Berard on this point a
- |lot. Basically, I think your assumption that a Circle shouldn't know
- |anything about a Line is mistaken. You wouldn't want to make Circle
- |independent of Point, would you? If you want to be able to intersect
- |geometric figures, and I claim that is *essential* to the meaning of
- |geometric figures, then you have to be able to compare one with another.
- |This means that you have to have something like intersectLine.
-
- The problem here is one of context. A circle, in and of itself,
- should not need to know anything about a Line. However, if that
- Circle is part of a family of objects, all of which know how to find
- their intersection with a Line, then the knowledge of Line is an
- attribute of the family which is inherited by its members. This is
- proper.
-
- |I claim that you don't want to make a Circle class that is an independent
- |standalone entity. The problem with small classes is that it takes too
- |much work to reuse them. There is much bigger payoff when classes come
- |in families of similar classes, because then you can learn one class and
- |then just reuse your knowledge for all the other classes. A Circle should
- |be part of a GeometricObject family of classes. There will be a standard
- |set of operations that all the classes must implement, such as intersecting
- |with a point or another GeometricObject. These classes will be designed
- |as a family and will probably be used as a family. You are unlikely to use
- |a Circle in an application and not use a Line.
-
- Agreed.
-
-
-
-
- --
- Robert Martin Training courses offered in:
- R. C. M. Consulting Object Oriented Analysis
- 2080 Cranbrook Rd. Object Oriented Design
- Green Oaks, Il 60048 (708) 918-1004 C++
-