<?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: Loading environment specific spring configurations.</title>
	<atom:link href="http://www.denoo.info/2009/09/loading-environment-specific-spring-configurations/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.denoo.info/2009/09/loading-environment-specific-spring-configurations/</link>
	<description>another java developer's blog</description>
	<lastBuildDate>Tue, 20 Oct 2009 16:29:50 +0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Job</title>
		<link>http://www.denoo.info/2009/09/loading-environment-specific-spring-configurations/comment-page-1/#comment-184</link>
		<dc:creator>Job</dc:creator>
		<pubDate>Sat, 12 Sep 2009 09:54:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.denoo.info/?p=33#comment-184</guid>
		<description>EnvironmentResolver just lookups the system property that identifies the environment, i&#039;m now on vacance but will add the code to this entry.
It is true that all environment specific contexts are being packaged. This is because we want to be able to create one war/ear file that passes by the different test environments and goes into production instead of creating a specific build for a certain environment.

But you could also put the configurations in a shared lib if you like</description>
		<content:encoded><![CDATA[<p>EnvironmentResolver just lookups the system property that identifies the environment, i&#8217;m now on vacance but will add the code to this entry.<br />
It is true that all environment specific contexts are being packaged. This is because we want to be able to create one war/ear file that passes by the different test environments and goes into production instead of creating a specific build for a certain environment.</p>
<p>But you could also put the configurations in a shared lib if you like</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stevo Slavic</title>
		<link>http://www.denoo.info/2009/09/loading-environment-specific-spring-configurations/comment-page-1/#comment-183</link>
		<dc:creator>Stevo Slavic</dc:creator>
		<pubDate>Thu, 10 Sep 2009 23:10:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.denoo.info/?p=33#comment-183</guid>
		<description>Example with tags was stripped off from &quot;... use wildcards like having  in data layer context...&quot;, so I&#039;ll rephrase that part: ...use wildcards like having import resource statement reference classpath resource like following: &quot;classpath:com/foo/bar/ctx/env-specific-datasource-config-*.xml&quot; in an (aggregator) data layer context</description>
		<content:encoded><![CDATA[<p>Example with tags was stripped off from &#8220;&#8230; use wildcards like having  in data layer context&#8230;&#8221;, so I&#8217;ll rephrase that part: &#8230;use wildcards like having import resource statement reference classpath resource like following: &#8220;classpath:com/foo/bar/ctx/env-specific-datasource-config-*.xml&#8221; in an (aggregator) data layer context</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stevo Slavic</title>
		<link>http://www.denoo.info/2009/09/loading-environment-specific-spring-configurations/comment-page-1/#comment-182</link>
		<dc:creator>Stevo Slavic</dc:creator>
		<pubDate>Thu, 10 Sep 2009 23:02:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.denoo.info/?p=33#comment-182</guid>
		<description>Since environment resolver is needed, correct me if I&#039;m wrong in assuming that all environment specific contexts are being packaged together in one deployment package regardless of the actual deployment environment. If my assumption is correct, it&#039;s not same but to me this is too similar to bundling test classes with the application in e.g. production deployment unit package, only in this case these are likely different development/test environment specific contexts, but still test stuff, being packaged with production code, which IMO is wrong thing to do.

If my assumption is wrong, and there is a deployment package for each environment and each deployment package contains only one variation of environment specific context(s), then I don&#039;t see need for environment resolver and extending Spring stuff but I do see some downsides. Why not configure build tool to have in deployment unit package for each environment these environment specific contexts either placed at same classpath location so they can be referenced in same way regardless of the environment, or employ naming convention and use wildcards like having &lt;code&gt;&lt;/code&gt; in data layer context? I prefer former (less wildcards less flexibility but more control) so with e.g. Maven 2 as build tool together with help of maven assembly plugin one can at one go build deployment artifacts for multiple different environments, each having only what&#039;s needed for that environment, be it configuration file or environment specific Spring context, all being referenced/loaded in same way regardless of the environment with no need to extend Spring (so less code, less potential bugs and fewer things to worry about during maintenance, like worrying what has to be done when migrating to Spring 3) and no need to configure environment variables or similar stuff for environment resolver (so easier deployment). Adding support for new environment is as flexible as in your/Joris&#039;s solution, one just has to create new environment specific context and extend build tool configuration (in maven2 assembly case by adding new assembly descriptor).</description>
		<content:encoded><![CDATA[<p>Since environment resolver is needed, correct me if I&#8217;m wrong in assuming that all environment specific contexts are being packaged together in one deployment package regardless of the actual deployment environment. If my assumption is correct, it&#8217;s not same but to me this is too similar to bundling test classes with the application in e.g. production deployment unit package, only in this case these are likely different development/test environment specific contexts, but still test stuff, being packaged with production code, which IMO is wrong thing to do.</p>
<p>If my assumption is wrong, and there is a deployment package for each environment and each deployment package contains only one variation of environment specific context(s), then I don&#8217;t see need for environment resolver and extending Spring stuff but I do see some downsides. Why not configure build tool to have in deployment unit package for each environment these environment specific contexts either placed at same classpath location so they can be referenced in same way regardless of the environment, or employ naming convention and use wildcards like having <code></code> in data layer context? I prefer former (less wildcards less flexibility but more control) so with e.g. Maven 2 as build tool together with help of maven assembly plugin one can at one go build deployment artifacts for multiple different environments, each having only what&#8217;s needed for that environment, be it configuration file or environment specific Spring context, all being referenced/loaded in same way regardless of the environment with no need to extend Spring (so less code, less potential bugs and fewer things to worry about during maintenance, like worrying what has to be done when migrating to Spring 3) and no need to configure environment variables or similar stuff for environment resolver (so easier deployment). Adding support for new environment is as flexible as in your/Joris&#8217;s solution, one just has to create new environment specific context and extend build tool configuration (in maven2 assembly case by adding new assembly descriptor).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Job</title>
		<link>http://www.denoo.info/2009/09/loading-environment-specific-spring-configurations/comment-page-1/#comment-179</link>
		<dc:creator>Job</dc:creator>
		<pubDate>Thu, 10 Sep 2009 09:09:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.denoo.info/?p=33#comment-179</guid>
		<description>i changed to article to link yours btw.</description>
		<content:encoded><![CDATA[<p>i changed to article to link yours btw.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Job</title>
		<link>http://www.denoo.info/2009/09/loading-environment-specific-spring-configurations/comment-page-1/#comment-178</link>
		<dc:creator>Job</dc:creator>
		<pubDate>Thu, 10 Sep 2009 09:04:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.denoo.info/?p=33#comment-178</guid>
		<description>He Joris,

yeah i think you started this kind of solution in firm, but is worked differently with a parent context. But the basic idea is indeed from there ;-) And give me a call when you have time to drink those beers, good luck and gz in anvance.</description>
		<content:encoded><![CDATA[<p>He Joris,</p>
<p>yeah i think you started this kind of solution in firm, but is worked differently with a parent context. But the basic idea is indeed from there <img src='http://www.denoo.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  And give me a call when you have time to drink those beers, good luck and gz in anvance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joris Kuipers</title>
		<link>http://www.denoo.info/2009/09/loading-environment-specific-spring-configurations/comment-page-1/#comment-176</link>
		<dc:creator>Joris Kuipers</dc:creator>
		<pubDate>Wed, 09 Sep 2009 11:22:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.denoo.info/?p=33#comment-176</guid>
		<description>Such a solution was first introduced in the FIRM application many years ago :)
I&#039;ve also described some solutions (incl. one that&#039;s very similar to yours) in this blog post:
http://blog.springsource.com/2007/06/25/code-samples-from-springone-beyond-the-obvious-talk/

Joris 

PS When I find some time I&#039;ll plan a date with you for those beers you still owe me ;)  Might take a while though, as I&#039;m becoming a father again this month...</description>
		<content:encoded><![CDATA[<p>Such a solution was first introduced in the FIRM application many years ago <img src='http://www.denoo.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I&#8217;ve also described some solutions (incl. one that&#8217;s very similar to yours) in this blog post:<br />
<a href="http://blog.springsource.com/2007/06/25/code-samples-from-springone-beyond-the-obvious-talk/" rel="nofollow">http://blog.springsource.com/2007/06/25/code-samples-from-springone-beyond-the-obvious-talk/</a></p>
<p>Joris </p>
<p>PS When I find some time I&#8217;ll plan a date with you for those beers you still owe me <img src='http://www.denoo.info/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   Might take a while though, as I&#8217;m becoming a father again this month&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
