<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: On Singletons</title>
	<atom:link href="http://www.zorched.net/2007/03/12/on-singletons/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zorched.net/2007/03/12/on-singletons/</link>
	<description>Musings of a software developer in Milwaukee, WI.</description>
	<pubDate>Tue, 06 Jan 2009 04:13:00 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Geoff Lane</title>
		<link>http://www.zorched.net/2007/03/12/on-singletons/comment-page-1/#comment-10956</link>
		<dc:creator>Geoff Lane</dc:creator>
		<pubDate>Wed, 12 Sep 2007 13:45:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.zorched.net/2007/03/12/on-singletons/#comment-10956</guid>
		<description>Amit,
Well, you could create constructors that are package-level protection and then have your factory or singleton-enforcer in the same package. The other thing that is common is to use a Dependency Injection container like Spring to manage the instances of your objects. Then it can be configured to only create and reuse a single instance.

In reality, neither of these really prevent people from making new instances though because you can get around those protection levels using Reflection. You enforce this just as much with convention as you do with structures in the code though. I think you need to be open to a little bit of ambiguity and uncertainty - then life will be beautiful! :)</description>
		<content:encoded><![CDATA[<p>Amit,<br />
Well, you could create constructors that are package-level protection and then have your factory or singleton-enforcer in the same package. The other thing that is common is to use a Dependency Injection container like Spring to manage the instances of your objects. Then it can be configured to only create and reuse a single instance.</p>
<p>In reality, neither of these really prevent people from making new instances though because you can get around those protection levels using Reflection. You enforce this just as much with convention as you do with structures in the code though. I think you need to be open to a little bit of ambiguity and uncertainty - then life will be beautiful! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit</title>
		<link>http://www.zorched.net/2007/03/12/on-singletons/comment-page-1/#comment-10954</link>
		<dc:creator>Amit</dc:creator>
		<pubDate>Wed, 12 Sep 2007 05:29:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.zorched.net/2007/03/12/on-singletons/#comment-10954</guid>
		<description>Hi Geoff!

I liked your article.. Even I wanted to separate singleton logic from the actual business logic.

You haven't shown in your factory code above how to enforce single instance of a class??
Can this behavior be enforced via ClassLoader?

I have a create( ) method in my factory class, which requires to instantiate instances of business objects such that only single instances exist in the JVM. How can I achieve this without applying singleton pattern to each and every business object??</description>
		<content:encoded><![CDATA[<p>Hi Geoff!</p>
<p>I liked your article.. Even I wanted to separate singleton logic from the actual business logic.</p>
<p>You haven&#8217;t shown in your factory code above how to enforce single instance of a class??<br />
Can this behavior be enforced via ClassLoader?</p>
<p>I have a create( ) method in my factory class, which requires to instantiate instances of business objects such that only single instances exist in the JVM. How can I achieve this without applying singleton pattern to each and every business object??</p>
]]></content:encoded>
	</item>
</channel>
</rss>
