Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: v_borchert@despammed.com (Volker Borchert) Newsgroups: comp.lang.java.programmer Subject: Re: Alternatives languages on the JVM: which one or is there no alternative? Date: 29 Nov 2013 23:37:56 GMT Organization: Private site at Eddersheim, Germany Lines: 43 Distribution: world Message-ID: References: X-Trace: individual.net NSJaVonA6KGrgT53g4+uEwJhAhy9iNeDXtVSdkoAC8a4aavGEI Cancel-Lock: sha1:FwZ3u6ihgVjWV2b9zNyFol40MP8= Xref: csiph.com comp.lang.java.programmer:26677 Joshua Cranmer ???? wrote: > And you think multiple inheritance has no costs? No. > 2. Offsets to a particular named field are dependent on object > instances, not on classes/class hierarchies. > 3. Casting up or down a tree requires recomputing offsets on a > per-object instance basis, not a per-class basis. If they had spent the time wasted on yet another GUI framwork on these... After all, that's what JIT is good at, isn't it? > inheritance, at least as > Java is concerned, is meant to model an "is-a" relationship, not a > "has-a" relationship. I know. And IMO this holds true generally, not only for Java. I admit that in my Cache example you could argue that the Entry _has_ a WeakReference rather than _being_ one. But then, being-a WeakReference is very similar to weakly-having-a V, isn't it? > Since inheritance is an indelible part of the > public contract of a class in Java, Another shortcoming of Java, but not necessarily of the JVM - lack of nonpublic inheritance. > Let the JIT and the optimizer work through the overhead; They can't work through the extra memory required for the extra object needed for aggregation. > premature optimization, after all, is the root of all evil. +1 -- "I'm a doctor, not a mechanic." Dr Leonard McCoy "I'm a mechanic, not a doctor." Volker Borchert