Article View: aus.computers.java
Article #245Re: Multiple interfaces
From: Wayne Berke
Date: Sat, 22 Jun 2002 13:21
Date: Sat, 22 Jun 2002 13:21
37 lines
3020 bytes
3020 bytes
"Darryl L. Pierce" wrote: > > On Thu, 20 Jun 2002 19:51:14 -0400, Wayne Berke wrote: > > >> That's not too bad. Except that there's no way to get back from the > >> Intf1 to the original myClass object. I'm not sure you should ever want > >> to, but I still feel alienated by this somehow. > >> > >> > > You could do this if you really wanted to do. What you'd have to do is > > enhance all your interfaces with an extra method: > > > > Object getContainingObject(); > > Ah, jaysus, now the interface that you want implemented has to have > specific knowledge of any object that _might_ be owner? Not at all. In fact the interfaces can even be pre-existing ones that don't contain the additional method. The bottom line is they only have the specific knowledge if they need to have it. > This is truly > getting to be spaghetti code now. Anything of the sort describe would > sure get marked in code review as needing to be reimplemented. What > you're describing shows a marked lack of design consideration. > Considering that your "code review" is based on flawed assumptions and simplistic reasoning, it's hard to take it too seriously. By the way, this problem has a very well-defined specification: given the inherent limitations of Java, provide a means for a class to simulate an is-a relationship with two mutually conflicting interfaces. Do you have any kind of solution yourself, or would you rather just stand on the sidelines and criticize others? Wayne
Technical Details
Message-ID:
<3D1479F6.464655B7@i.hate.spam>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!feed2.news.rcn.net!feed1.news.rcn.net!rcn!not-for-mailReferences:
<1024283082.192985@web.apex.net.au> <JScP8.111$Fv1.17660@newsread2.prod.itd.earthlink.net> <1024289793.45649@web.apex.net.au> <pan.2002.06.17.07.46.24.235390.777@databasix.com> <3D0F7E91.5010401@krang.f9.co.uk> <3d10edc6.1491361@news.virgin.net> <3D1101BE.40506@krang.f9.co.uk> <3d121553.1321895@news.virgin.net> <3D126A72.4123E49B@i.hate.spam> <pan.2002.06.21.07.16.04.89148.1938@databasix.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,113f3357bc588129 X-Google-Attributes: gid10d6db,public X-Google-Thread: 10a146,113f3357bc588129 X-Google-Attributes: gid10a146,public X-Google-Thread: f74b3,113f3357bc588129 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2002-06-22 06:22:01 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!feed2.news.rcn.net!feed1.news.rcn.net!rcn!not-for-mail From: Wayne Berke <notme@i.hate.spam> Newsgroups: aus.computers.java,borland.public.jbuilder.java.language,comp.lang.java.programmer Subject: Re: Multiple interfaces Date: Sat, 22 Jun 2002 09:21:58 -0400 Lines: 37 Message-ID: <3D1479F6.464655B7@i.hate.spam> References: <1024283082.192985@web.apex.net.au> <JScP8.111$Fv1.17660@newsread2.prod.itd.earthlink.net> <1024289793.45649@web.apex.net.au> <pan.2002.06.17.07.46.24.235390.777@databasix.com> <3D0F7E91.5010401@krang.f9.co.uk> <3d10edc6.1491361@news.virgin.net> <3D1101BE.40506@krang.f9.co.uk> <3d121553.1321895@news.virgin.net> <3D126A72.4123E49B@i.hate.spam> <pan.2002.06.21.07.16.04.89148.1938@databasix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit X-Trace: UmFuZG9tSVaPAjU8qAcwdw9BjQAX8xS8T4HaoCZXlYve3cQ5iCOTvl35SqpGLGcD X-Complaints-To: abuse@rcn.com NNTP-Posting-Date: 22 Jun 2002 13:21:48 GMT X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.0.38 i386) X-Accept-Language: en