<?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: Spring annotations static injection tutorial</title>
	<atom:link href="http://www.connorgarvey.com/blog/?feed=rss2&#038;p=105" rel="self" type="application/rss+xml" />
	<link>http://www.connorgarvey.com/blog/?p=105</link>
	<description>Connor Garvey's application development notes</description>
	<lastBuildDate>Wed, 08 Sep 2010 08:42:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Tyrone Hed</title>
		<link>http://www.connorgarvey.com/blog/?p=105&#038;cpage=1#comment-2323</link>
		<dc:creator>Tyrone Hed</dc:creator>
		<pubDate>Thu, 22 Jul 2010 15:49:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.connorgarvey.com/blog/?p=105#comment-2323</guid>
		<description>The problem with this approach is that the setter injection of a non-static variable can happen AFTER the static variable has already been used. So, beans that use the static variable before it has been initialized by the non-static setter will get the default value of the property while beans that use the property later will get the initialized value. So, this is not a perfect solution.</description>
		<content:encoded><![CDATA[<p>The problem with this approach is that the setter injection of a non-static variable can happen AFTER the static variable has already been used. So, beans that use the static variable before it has been initialized by the non-static setter will get the default value of the property while beans that use the property later will get the initialized value. So, this is not a perfect solution.</f</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joksy</title>
		<link>http://www.connorgarvey.com/blog/?p=105&#038;cpage=1#comment-1258</link>
		<dc:creator>Joksy</dc:creator>
		<pubDate>Tue, 01 Jun 2010 06:48:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.connorgarvey.com/blog/?p=105#comment-1258</guid>
		<description>@MattL, hi man, personally i use static constants as a key for both sessions and Context in generals, the point is accesibility, a public static variable it is accessible everywhere, whereas singleton object handle by spring appcontext means that you have a reference of that context.

for sure there are some reason why spring arch. did not develop the support for this point anyway a workaround always exist.</description>
		<content:encoded><![CDATA[<p>@MattL, hi man, personally i use static constants as a key for both sessions and Context in generals, the point is accesibility, a public static variable it is accessible everywhere, whereas singleton object handle by spring appcontext means that you have a reference of that context.</p><p>for sure there are some reason why spring arch. did not develop the support for this point anyway a workaround always exist.</f</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andras Hatvani</title>
		<link>http://www.connorgarvey.com/blog/?p=105&#038;cpage=1#comment-803</link>
		<dc:creator>Andras Hatvani</dc:creator>
		<pubDate>Sun, 28 Mar 2010 12:15:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.connorgarvey.com/blog/?p=105#comment-803</guid>
		<description>Nice hint, added to bookmarks ;) However, it doesn&#039;t work with JUnit 4 test cases, where I wanted to inject a resource used for initializing another field in @BeforeClass which has to be static.

@MattL: static definitely isn&#039;t about changes, so I&#039;m not sure, whether your rule makes any sense...</description>
		<content:encoded><![CDATA[<p>Nice hint, added to bookmarks <img src='http://www.connorgarvey.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  However, it doesn&#8217;t work with JUnit 4 test cases, where I wanted to inject a resource used for initializing another field in @BeforeClass which has to be static.</p><p>@MattL: static definitely isn&#8217;t about changes, so I&#8217;m not sure, whether your rule makes any sense&#8230;</f</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MattL</title>
		<link>http://www.connorgarvey.com/blog/?p=105&#038;cpage=1#comment-18</link>
		<dc:creator>MattL</dc:creator>
		<pubDate>Fri, 20 Feb 2009 17:12:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.connorgarvey.com/blog/?p=105#comment-18</guid>
		<description>I always considered Spring&#039;s lack of static injection a feature.
The semantics of static properties and especially singletons are often not fully understood and can result in very obscure problems and assumptions. This is especially true when serialization, persistence and remoting are involved.

My rule is: never use static properties unless their value is guaranteed never to change ever for the life of the universe.

Spring has a better option - define an object to be a singleton within some context e.g. the application context. Then we can tidy up the semantics for persistence and clustering and not use statics.

Just my 2c.</description>
		<content:encoded><![CDATA[<p>I always considered Spring&#8217;s lack of static injection a feature.<br />The semantics of static properties and especially singletons are often not fully understood and can result in very obscure problems and assumptions. This is especially true when serialization, persistence and remoting are involved.</p><p>My rule is: never use static properties unless their value is guaranteed never to change ever for the life of the universe.</p><p>Spring has a better option &#8211; define an object to be a singleton within some context e.g. the application context. Then we can tidy up the semantics for persistence and clustering and not use statics.</p><p>Just my 2c.</f</p>
]]></content:encoded>
	</item>
</channel>
</rss>
