Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 16 Aug 2011 00:07:31 -0500 Date: Mon, 15 Aug 2011 22:07:28 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Singleton Pattern References: <3be6e6cf-fa32-4503-9457-b0a1caef8f29@w11g2000vbp.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4o6dnfZWI_mOZtTTnZ2dnUVZ_oqdnZ2d@earthlink.com> Lines: 17 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.203.65 X-Trace: sv3-pPZPiLT4FP6rLHqVqlJme01wYlDANb57Fvrk0GgFwclzg2DL2Wtjc9nVv1xnPFOj3uI38rmqP9Jn4WB!Pi8Y2f1f8p1ReSwNNxDWD9DbKhiz/+rTS45ktyYkzWiSmWGwQT9kY+KFSC4Lx1apivH1qso8NwB5!3GqBo+sJ6s8e7kqggovn41EH4jAwQcJfN4V7diU7n8/vhA== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2060 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7131 On 8/15/2011 7:56 AM, Lew wrote: ... > Final fields, especially immutable ones, make a lot of useful > guarantees, and you don't have the field in the first place unless > it's going to be used at some point anyway. Just freaking initialize > it! Different program runs do different things, so there can be fields that are used some runs but not others. That is especially the case for library classes that may be used in many different programs. However, the initializer for a static field executes during class initialization. How often does a singleton class get initialized without its getInstance method ever being called? Patricia