Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!news.glorb.com!news.astraweb.com!border6.newsrouter.astraweb.com!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: Composition instead of inheritance References: X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney Date: Fri, 29 Apr 2011 14:14:36 +1000 Message-ID: <87fwp1k82b.fsf@benfinney.id.au> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:etLlRF9LkF+Ia3Z75GIfkSuBQJo= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Lines: 20 Organization: Unlimited download news at news.astraweb.com NNTP-Posting-Host: 1df3216d.news.astraweb.com X-Trace: DXC=i0S;;3l writes: > On Thu, Apr 28, 2011 at 3:35 PM, Carl Banks wrote: > > That's not what we mean by composition.  Composition is when one > > object calls upon another object that it owns to implement some of > > its behavior.  Often used to model a part/whole relationship, hence > > the name. > > It's a pretty old idea, that seems to be getting revived in a big way > all of a sudden. Perhaps the Java people just rediscovered it? I think it's more that people keep re-discovering how irredeemably messy multiple inheritance is, and finding that object composition is better in most cases :-) -- \ “There's a fine line between fishing and standing on the shore | `\ looking like an idiot.” —Steven Wright | _o__) | Ben Finney