Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED.c-24-60-169-94.hsd1.ma.comcast.net!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: multiple inheritance in Java Date: Tue, 02 Jul 2013 08:13:06 -0400 Organization: A noiseless patient Spider Lines: 29 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 2 Jul 2013 12:07:42 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="c-24-60-169-94.hsd1.ma.comcast.net:24.60.169.94"; logging-data="5206"; mail-complaints-to="abuse@eternal-september.org"; posting-account="esosman" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:24577 On 7/2/2013 6:02 AM, Stefan Ram wrote: > Eric Sosman writes: >> Still, I don't see the relevance of multiple inheritance to >> your question, which seems to boil down to: "What are the trade-offs >> in exposing fields vs. using accessors?" I think we can debate (have >> debated) that matter at length without involving M.I. -- so it seems >> I'm still missing your intent. > > When an object O exposes two public fields of two classes P and Q, > this has some of the benefits that mutiple inheritance from both > P and Q would have, while one does not tediously has to code > a lot of delegating methods in this object O. > > (When I really implement this, P and Q actually are interfaces, > but the during the creation of O an implementation of those > interfaces is assigned to their corresponding fields in O.) I still don't see the relevance of M.I. to the question. Thought experiment: How would anything change if you were to remove Q from the scenario altogether? > This might also be called »poor man's multiple inheritance«. I'm not sure why anyone would use that term for "making a field public." -- Eric Sosman esosman@comcast-dot-net.invalid