Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Enums: Properties vs. Methods Date: Sun, 03 Apr 2011 13:14:18 +0200 Lines: 31 Message-ID: <8vr34cF6ctU1@mid.individual.net> References: <2f38bb8e-9a8d-4464-ad3d-b9ce0b557219@e21g2000yqe.googlegroups.com> <8vh9efFg01U1@mid.individual.net> <0187eb75-7f36-4254-9711-f63ff480f62e@j13g2000yqj.googlegroups.com> <1f76f26d-4b21-4a26-92b4-bb6553b9cad6@f30g2000yqa.googlegroups.com> <8voa70Fuk3U1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: individual.net 3pvhOs9GGb4TKdpuVzP+MAXzqQSw0UIE/MSnfIIFqAxlywvXs= Cancel-Lock: sha1:wFUoVNpsu1C77BA9X5d9ACHjFrk= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 In-Reply-To: X-Antivirus: avast! (VPS 110403-0, 03.04.2011), Outbound message X-Antivirus-Status: Clean Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2799 On 02.04.2011 16:29, Lew wrote: > Robert Klemme wrote: >> Lew wrote: >>> Robert Klemme wrote: >>>> Lew wrote: >>>>> Start here: JLS, =A717.5.3, as I cited earlier. >>>> >>>> It seems that is not a good place to start (see other postings). :-)= >>> >>> Indeed. >> >> What now? > > Do you mean how do we distinguish the two alternatives now? I rather meant what is the assessment of the community about possible=20 optimizations applied by the JVM to both approaches? My personal=20 opinion at this point is that the "properties" approach might be more=20 efficient since getter methods can be inlined (there is just one class=20 so there are not multiple variants for e.isOpen() as opposed to having=20 different classes). Cheers robert --=20 remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/