home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watdragon.uwaterloo.ca!drraymon
- From: drraymon@watdragon.uwaterloo.ca (Darrell Raymond)
- Subject: Delegation? Composition? Layering? Containment?
- Message-ID: <Bzzqo4.E5J@watdragon.uwaterloo.ca>
- Organization: University of Waterloo
- Date: Mon, 28 Dec 1992 22:33:40 GMT
- Lines: 22
-
- One sometimes includes an instance of a class within a class, thus
- achieving information hiding without inheritance. That is, instead
- of doing:
-
- class foo : public bar { .... }
-
- one would do
-
- class foo { bar x; ... }
-
- My question is, what do people generally call the second technique?
- I have seen it described as `layering' (Meyers, Effective C++, p. 142),
- `composition' (Lippman, p. 415), `containment' (Stroustrup, p. 410),
- and I believe Gorlen et al. even refer to this as `delegation', which
- is what I used to call it. I don't think it is delegation, however,
- since it does not confer the ability to redirect messages to an
- arbitrary object.
-
- Do people have a preference for one of the other terms? I'll moderate
- an e-mail vote and post the results, if anyone cares...
-
- -Darrell.
-