From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,953e1a6689d791f6 X-Google-Attributes: gidfac41,public X-Google-Thread: f79bb,953e1a6689d791f6 X-Google-Attributes: gidf79bb,public X-Google-Thread: 103376,953e1a6689d791f6 X-Google-Attributes: gid103376,public X-Google-Thread: fdb77,953e1a6689d791f6 X-Google-Attributes: gidfdb77,public From: dbudor@zems.fer.hr (Darko BUDOR) Subject: Re: Eiffel and Java Date: 1996/11/03 Message-ID: <55j7fi$f4d@bagan.srce.hr>#1/1 X-Deja-AN: 194163108 distribution: world references: <550sm2$sn1@buggy.news.easynet.net> <55562c$nkd@mulga.cs.mu.OZ.AU> <55ffdb$cki@bagan.srce.hr> <55fhfu$8p0@mulga.cs.mu.OZ.AU> followup-to: comp.lang.eiffel,comp.lang.ada,comp.lang.sather,comp.lang.java.advocacy content-type: text/plain; charset=US-ASCII organization: ZEMS-FER mime-version: 1.0 newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.sather,comp.lang.java.advocacy Date: 1996-11-03T00:00:00+00:00 List-Id: Fergus Henderson (fjh@murlibobo.cs.mu.OZ.AU) wrote: : ]: (Is that possible in Java?) : ] : ]Yes, it is. : : If your code below is the only way of doing it, then I would say that : it *isn't* possible in Java. The code below doesn't do the same : thing as the Sather code -- it has significant disadvantages. It doesn't do the same thing, but that is as close as you can get. : Disadvantage number one: you have to manually delegate all the constructors. : That is tedious and causes maintenance difficulties when someone later adds : new constructors for A. So you will have to add one to MyA, if you want to use it. I see no problem there. : ]and use MyA and MyB instead of A and B. : : Disadvantage number two: you can't use the new interface on the : original types. This is *really* bad news. It basically means is that : you can't use this method when interfacing with existing code that uses : A and B rather than MyA and MyB. That IS a bit of a problem, but it could be solved with copy constructors in derived classes, IMHO. -- Darko Budor -- budor@fly.cc.fer.hr; dbudor@diana.zems.fer.hr All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can't get them together again, there must be a reason. By all means, do not use a hammer. --IBM maintenance manual, 1925