<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2germanfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Philipp Meier's weblog</title>
	
	<link>http://www.fnogol.de</link>
	<description>Philipp Meier writes about Java and Java Software Development.</description>
	<pubDate>Tue, 17 Feb 2009 07:52:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<feedburner:info uri="fnogol" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://fnogol.de/feed" /><item>
		<title>Dependency Injection is not only about compile time dependencies</title>
		<link>http://feedproxy.google.com/~r/fnogol/~3/2v7eq7GPsxM/</link>
		<comments>http://www.fnogol.de/archives/2008/08/20/dependency-injection-is-not-only-about-compile-time-dependencies/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 09:04:57 +0000</pubDate>
		<dc:creator>Philipp Meier</dc:creator>
		
		<category><![CDATA[java]]></category>

		<category><![CDATA[dependency injection]]></category>

		<category><![CDATA[ioc]]></category>

		<guid isPermaLink="false">http://www.fnogol.de/?p=73</guid>
		<description><![CDATA[Tinou complains that dependency Injection was broken. I want to add some points to his / her statements:
The problem I&#8217;ve always had with DI frameworks, be it Spring or Guice, is they create this nasty dependency tree.  If you don&#8217;t want to use GlobalApplicationContext.getBean() or Injector.getInstance() then you&#8217;ll need to inject all your dependencies [...]]]></description>
			<content:encoded><![CDATA[<p>Tinou complains that <a href="http://floatingpoint.tinou.com/2008/08/fixing-dependency-injection-with-interface-reification.html">dependency Injection was broken</a>. I want to add some points to his / her statements:</p>
<blockquote><p>The problem I&#8217;ve always had with DI frameworks, be it Spring or Guice, is they create this nasty dependency tree.  If you don&#8217;t want to use GlobalApplicationContext.getBean() or Injector.getInstance() then you&#8217;ll need to inject all your dependencies at the root.  It annoys the crap out of me, but I suppose there&#8217;s just no way around it&#8230;<br />
Except if the language had a mechanism to realize interfaces and abstract classes at runtime, either built-in or through some extension.<br />
[...]The fundamental problem with all dependency injection tools is they are trying to do what  language should be doing (instantiating objects that implement some interface[!]).
</p></blockquote>
<p>These toughts might be correct if you reduce dependency injection to &#8220;instanciate a class that implement this or that inferface&#8221;. But I understand dependency injection as a tool for inversion of control and decoupling of implementations. Dependency injection shall enable the developer to reconfigure the application without compilation of the compontents that depend on eachother.</p>
<p>Yes, at some point you will have to decide which implementation of a certain interface shall be used, and one can argue where this &#8220;wiring information&#8221; should be placed: <a href="http://www.springframework.org">Spring</a> uses an XML file, <a href="http://www.picocontainer.org/">PicoContainer</a>s can be composed hierachically, <a href="code.google.com/p/google-guice/">guice</a> can use annotations. But if you have only one implementation of the interface you can do without a dependency injection framework at all.</p>
<h3>Updates</h3>
<ul>
<li>Fixed typos</li>
<li>As pointed out by Paul Hammant PicoContainer of course can be configured with XML as well as with Groovy, Python, Beanshell and Ruby. I&#8217;m sure one can add Yaml and Json easily as well. Furthermore I think this is possible to some extend for Spring and Guice as well and the <a href="http://www.qi4j.org/">Qi4J</a> developers would be able to add something to this, too. What I wanted to make clear is that one can argue about when, where and how to wire the components; the different ways the mentioned frameworks offer emphasize this.</li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/fnogol?a=2v7eq7GPsxM:iG5h75VQQYI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=2v7eq7GPsxM:iG5h75VQQYI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/fnogol?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=2v7eq7GPsxM:iG5h75VQQYI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=2v7eq7GPsxM:iG5h75VQQYI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/fnogol?i=2v7eq7GPsxM:iG5h75VQQYI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=2v7eq7GPsxM:iG5h75VQQYI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/fnogol?i=2v7eq7GPsxM:iG5h75VQQYI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=2v7eq7GPsxM:iG5h75VQQYI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/fnogol?i=2v7eq7GPsxM:iG5h75VQQYI:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.fnogol.de/archives/2008/08/20/dependency-injection-is-not-only-about-compile-time-dependencies/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.fnogol.de/archives/2008/08/20/dependency-injection-is-not-only-about-compile-time-dependencies/</feedburner:origLink></item>
		<item>
		<title>This must be shared: /^1?$|^(11+?)\1+$/ to check for prime numbers</title>
		<link>http://feedproxy.google.com/~r/fnogol/~3/1vR_yJubUbM/</link>
		<comments>http://www.fnogol.de/archives/2008/02/27/this-must-be-shared-1111-to-check-for-prime-numbers/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 09:54:54 +0000</pubDate>
		<dc:creator>Philipp Meier</dc:creator>
		
		<category><![CDATA[java]]></category>

		<category><![CDATA[hack]]></category>

		<category><![CDATA[math]]></category>

		<category><![CDATA[perl]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://www.fnogol.de/archives/2008/02/27/this-must-be-shared-1111-to-check-for-prime-numbers/</guid>
		<description><![CDATA[That&#8217;s all and checks if a string does not consist of a prime number of &#8220;1&#8220;, e.g. &#8220;111&#8221; is prime whereas &#8220;1111&#8221; is not:

/^1?$&#124;^(11+?)\1+$/

Although this seems cryptic its rather straight forward: match on either &#8220;&#8221; or &#8220;1&#8221; (first part until &#8220;&#124;&#8220;) or match on  a substring of 2 or more &#8220;1&#8221; with repeatedly fits [...]]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s all and checks if a string does not consist of a prime number of &#8220;<code>1</code>&#8220;, e.g. &#8220;<code>111</code>&#8221; is prime whereas &#8220;<code>1111</code>&#8221; is not:</p>
<textarea name="code" class="ruby:showcolumns" cols="60" rows="10">
/^1?$|^(11+?)\1+$/
</textarea>
<p>Although this seems cryptic its rather straight forward: match on either &#8220;&#8221; or &#8220;<code>1</code>&#8221; (first part until &#8220;<code>|</code>&#8220;) or match on  a substring of 2 or more &#8220;<code>1</code>&#8221; with repeatedly fits the whole. For the string &#8220;<code>111111</code>&#8221; the substring &#8220;<code>11</code>&#8221; fits in 3 times.</p>
<p>Over all its a very high level description of a primality test. I never considered regular expressions as a mathematical domain language.</p>
<p>More details on <a href="http://www.noulakaz.net/weblog/2007/03/18/a-regular-expression-to-check-for-prime-numbers/">Avinash Meetoo&#8217;s Blog</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/fnogol?a=1vR_yJubUbM:Z_5FjxmaB1o:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=1vR_yJubUbM:Z_5FjxmaB1o:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/fnogol?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=1vR_yJubUbM:Z_5FjxmaB1o:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=1vR_yJubUbM:Z_5FjxmaB1o:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/fnogol?i=1vR_yJubUbM:Z_5FjxmaB1o:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=1vR_yJubUbM:Z_5FjxmaB1o:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/fnogol?i=1vR_yJubUbM:Z_5FjxmaB1o:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=1vR_yJubUbM:Z_5FjxmaB1o:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/fnogol?i=1vR_yJubUbM:Z_5FjxmaB1o:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.fnogol.de/archives/2008/02/27/this-must-be-shared-1111-to-check-for-prime-numbers/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.fnogol.de/archives/2008/02/27/this-must-be-shared-1111-to-check-for-prime-numbers/</feedburner:origLink></item>
		<item>
		<title>Don’t subclass DefautListCellRenderer for Swing’s Nimbus LAF</title>
		<link>http://feedproxy.google.com/~r/fnogol/~3/etCXRMZYaho/</link>
		<comments>http://www.fnogol.de/archives/2008/02/07/dont-subclass-defautlistcellrenderer-for-nimbus/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 15:35:30 +0000</pubDate>
		<dc:creator>Philipp Meier</dc:creator>
		
		<category><![CDATA[java]]></category>

		<category><![CDATA[jcombobox]]></category>

		<category><![CDATA[nimbus]]></category>

		<category><![CDATA[render]]></category>

		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">http://www.fnogol.de/archives/2008/02/07/dont-subclass-defautlistcellrenderer-for-nimbus/</guid>
		<description><![CDATA[If you follow the common practice to subclass JLabel to add some formatting to your combobox you will be surprised that this will break the rendering of JComboBoxes  in the Nimbus Look Ant Feel.

Basically the nice glass like look of the combobox will disappear and the old flat look will be restored. This comes [...]]]></description>
			<content:encoded><![CDATA[<p>If you follow the <a href="http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html#renderer">common practice</a> to subclass JLabel to add some formatting to your combobox you will be surprised that this will break the rendering of <code>JComboBoxes </code> in the <a href="https://nimbus.dev.java.net/">Nimbus</a> Look Ant Feel.</p>
<p><a href='http://www.fnogol.de/wp-content/uploads/2008/02/renderer-nimbus-bad.png' title='Examples of bad JLabel-based CellRenderer'><img src='http://www.fnogol.de/wp-content/uploads/2008/02/renderer-nimbus-bad.png' alt='Examples of bad JLabel-based CellRenderer' /></a></p>
<p>Basically the nice glass like look of the combobox will disappear and the old flat look will be restored. This comes due to Nimbus using a custom CellRenderer:</p>
<p><code>javax.swing.plaf.synth.SynthComboBoxUI$SynthComboBoxRenderer</code></p>
<p>Fortunately this renderer is based on JLabel, too. This is why you can simply wrap the renderer and add some blinkenlights when needed:</p>
<p><a href='http://www.fnogol.de/wp-content/uploads/2008/02/renderer-nimbus-good.png' title='Good example of renderer wrapping the original renderer'><img src='http://www.fnogol.de/wp-content/uploads/2008/02/renderer-nimbus-good.png' alt='Good example of renderer wrapping the original renderer' /></a></p>
<p>The implementation is straight forward:</p>
<textarea name="code" class="java:showcolumns" cols="60" rows="10">
public class InstanceWithIconCellRendererWrapper implements ListCellRenderer {
	private final ListCellRenderer wrapped;
	public InstanceWithIconCellRendererWrapper(ListCellRenderer listCellRenderer) {
		this.wrapped = listCellRenderer;
	}
	public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
		String displayName = String.valueOf(value); // customize here
		Component renderer = wrapped.getListCellRendererComponent(list, displayName, index, isSelected, cellHasFocus);
		if (renderer instanceof JLabel) {
			Icon icon = new ImageIcon(); // customize here
			((JLabel) renderer).setIcon(icon);
		}
		return renderer;
	}
}
</textarea>
<p>Use it as follows:</p>
<p><code><br />
jComboBox.setRenderer(new InstanceWithIconCellRendererWrapper(jComboBox.getRenderer()));<br />
</code></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/fnogol?a=etCXRMZYaho:-xH1E2dszNc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=etCXRMZYaho:-xH1E2dszNc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/fnogol?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=etCXRMZYaho:-xH1E2dszNc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=etCXRMZYaho:-xH1E2dszNc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/fnogol?i=etCXRMZYaho:-xH1E2dszNc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=etCXRMZYaho:-xH1E2dszNc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/fnogol?i=etCXRMZYaho:-xH1E2dszNc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=etCXRMZYaho:-xH1E2dszNc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/fnogol?i=etCXRMZYaho:-xH1E2dszNc:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.fnogol.de/archives/2008/02/07/dont-subclass-defautlistcellrenderer-for-nimbus/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.fnogol.de/archives/2008/02/07/dont-subclass-defautlistcellrenderer-for-nimbus/</feedburner:origLink></item>
		<item>
		<title>Free Burma</title>
		<link>http://feedproxy.google.com/~r/fnogol/~3/9piC2Vl-nzk/</link>
		<comments>http://www.fnogol.de/archives/2007/10/04/free-burma/#comments</comments>
		<pubDate>Thu, 04 Oct 2007 14:27:52 +0000</pubDate>
		<dc:creator>Philipp Meier</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<category><![CDATA[free burma]]></category>

		<guid isPermaLink="false">http://www.fnogol.de/archives/2007/10/04/free-burma/</guid>
		<description><![CDATA[


]]></description>
			<content:encoded><![CDATA[<p><!-- Free Burma! Image --><br />
<a href="http://www.free-burma.org" target="_blank"><img src="http://freeburma.s3.amazonaws.com/free_burma_01.gif" alt="Free Burma!" width="434" height="165" border="0" /></a><br />
<!-- End Free Burma! Image --></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/fnogol?a=9piC2Vl-nzk:uIWRPjEAzxk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=9piC2Vl-nzk:uIWRPjEAzxk:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/fnogol?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=9piC2Vl-nzk:uIWRPjEAzxk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=9piC2Vl-nzk:uIWRPjEAzxk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/fnogol?i=9piC2Vl-nzk:uIWRPjEAzxk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=9piC2Vl-nzk:uIWRPjEAzxk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/fnogol?i=9piC2Vl-nzk:uIWRPjEAzxk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=9piC2Vl-nzk:uIWRPjEAzxk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/fnogol?i=9piC2Vl-nzk:uIWRPjEAzxk:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.fnogol.de/archives/2007/10/04/free-burma/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.fnogol.de/archives/2007/10/04/free-burma/</feedburner:origLink></item>
		<item>
		<title>Die! Singletons Die!</title>
		<link>http://feedproxy.google.com/~r/fnogol/~3/Qn1fgwb0zSQ/</link>
		<comments>http://www.fnogol.de/archives/2007/07/04/die-singletons-die/#comments</comments>
		<pubDate>Wed, 04 Jul 2007 13:19:50 +0000</pubDate>
		<dc:creator>Philipp Meier</dc:creator>
		
		<category><![CDATA[java]]></category>

		<category><![CDATA[pattern]]></category>

		<category><![CDATA[rant]]></category>

		<category><![CDATA[singleton]]></category>

		<guid isPermaLink="false">http://www.fnogol.de/archives/2007/07/04/die-singletons-die/</guid>
		<description><![CDATA[Enough is sayed here at Pure Danger Tech. Please let those singletons die, however there is no real singleton with java anyway.
]]></description>
			<content:encoded><![CDATA[<p>Enough is sayed here at <a href="http://tech.puredanger.com/2007/07/03/pattern-hate-singleton/">Pure Danger Tech</a>. Please let those singletons die, however there is no real singleton with java anyway.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/fnogol?a=Qn1fgwb0zSQ:vDhXGvzVZx0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=Qn1fgwb0zSQ:vDhXGvzVZx0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/fnogol?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=Qn1fgwb0zSQ:vDhXGvzVZx0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=Qn1fgwb0zSQ:vDhXGvzVZx0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/fnogol?i=Qn1fgwb0zSQ:vDhXGvzVZx0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=Qn1fgwb0zSQ:vDhXGvzVZx0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/fnogol?i=Qn1fgwb0zSQ:vDhXGvzVZx0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=Qn1fgwb0zSQ:vDhXGvzVZx0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/fnogol?i=Qn1fgwb0zSQ:vDhXGvzVZx0:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.fnogol.de/archives/2007/07/04/die-singletons-die/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.fnogol.de/archives/2007/07/04/die-singletons-die/</feedburner:origLink></item>
		<item>
		<title>Where is inversion of control in JSR 296 (Swing Application Framework)?</title>
		<link>http://feedproxy.google.com/~r/fnogol/~3/YMiZhpS66pU/</link>
		<comments>http://www.fnogol.de/archives/2007/07/03/where-is-inversion-of-control-in-jsr-296-swing-application-framework/#comments</comments>
		<pubDate>Tue, 03 Jul 2007 12:21:48 +0000</pubDate>
		<dc:creator>Philipp Meier</dc:creator>
		
		<category><![CDATA[java]]></category>

		<category><![CDATA[ioc]]></category>

		<category><![CDATA[jsr]]></category>

		<category><![CDATA[jsr-296]]></category>

		<guid isPermaLink="false">http://www.fnogol.de/archives/2007/07/03/where-is-inversion-of-control-in-jsr-296-swing-application-framework/</guid>
		<description><![CDATA[JSR-296 will provide us with nice ressource management. You can get property settings like label texts, colors and other properties from ressource files easily:

ApplicationContext ctxt = ApplicationContext.getInstance();
ResourceManager mgr = ctxt.getResourceManager();
resource = mgr.getResourceMap(HelloWorld.class);
String helloText = (String) resource.getObject("helloLabel", String.class);

But&#8230; what is this ApplicationContext.getInstance() static method call? Where is dependency injection? Look into the API documentation of ApplicationContext: [...]]]></description>
			<content:encoded><![CDATA[<p>JSR-296 will provide us with nice ressource management. You can get property settings like label texts, colors and other properties from ressource files easily:</p>
<p><code>
<pre>ApplicationContext ctxt = ApplicationContext.getInstance();
ResourceManager mgr = ctxt.getResourceManager();
resource = mgr.getResourceMap(HelloWorld.class);
String helloText = (String) resource.getObject("helloLabel", String.class);</pre>
<p></code></p>
<p>But&#8230; what is this ApplicationContext.getInstance() static method call? Where is <a href="http://www.martinfowler.com/articles/injection.html">dependency injection</a>? Look into the API documentation of <a href="https://appframework.dev.java.net/nonav/javadoc/AppFramework-0.43/application/ApplicationContext.html">ApplicationContext</a>: it&#8217;s a global service locator. That means it provides a fixed bunch of services which are accessible by a singleton instance. You can of course use aggregation, sub-classing and delegation to extend it&#8217;s abilities but dependency injection is the train everyone jumps onto, ain&#8217;t it?</p>
<p>There is another issue that puzzles me: where are the interfaces? A framework whithout any interface? It&#8217;s even worse, ApplicationContext returns instances of concrete classes, not even abstract classes. So you&#8217;ll always get an instance of class <code><a href="https://appframework.dev.java.net/nonav/javadoc/AppFramework-0.43/application/ResourceManager.html">RessourceManager</a></code>. I you like to provide your own, you can only sub-class it, at least, <code><a href="https://appframework.dev.java.net/nonav/javadoc/AppFramework-0.43/application/ResourceManager.html">RessourceManager</a></code> is not final.</p>
<p>Can I have some dependeny injection, please? <a href="http://www.picocontainer.org/">Picocontainer</a>, <a href="http://code.google.com/p/google-guice/">Guice</a> or <a href="http://static.springframework.org/spring/docs/2.0.x/reference/beans.html">Spring</a>, perhaps? Yes, I can but it would be more nice, if RessourceManager,  <a href="https://appframework.dev.java.net/nonav/javadoc/AppFramework-0.43/application/ActionManager.html">ActionManager</a> and all other services provided by the framework would be interfaces and I could use any implemention I wish.</p>
<p>By the way, there is some dependency injection in the framework: you can inject property values into any awt component with <a href="https://appframework.dev.java.net/nonav/javadoc/AppFramework-0.43/application/ResourceMap.html#injectComponent(java.awt.Component)">RessourceManager.injectComponent</a>. I hope the method name is not final yet, because I expected an component to be injected into some other instance, not something to be injected into a component.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/fnogol?a=YMiZhpS66pU:TdpkfCd-vR0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=YMiZhpS66pU:TdpkfCd-vR0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/fnogol?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=YMiZhpS66pU:TdpkfCd-vR0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=YMiZhpS66pU:TdpkfCd-vR0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/fnogol?i=YMiZhpS66pU:TdpkfCd-vR0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=YMiZhpS66pU:TdpkfCd-vR0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/fnogol?i=YMiZhpS66pU:TdpkfCd-vR0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=YMiZhpS66pU:TdpkfCd-vR0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/fnogol?i=YMiZhpS66pU:TdpkfCd-vR0:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.fnogol.de/archives/2007/07/03/where-is-inversion-of-control-in-jsr-296-swing-application-framework/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.fnogol.de/archives/2007/07/03/where-is-inversion-of-control-in-jsr-296-swing-application-framework/</feedburner:origLink></item>
		<item>
		<title>Generate application.xml from ivy.xml for packaging an ear</title>
		<link>http://feedproxy.google.com/~r/fnogol/~3/kC_EcpqpsV0/</link>
		<comments>http://www.fnogol.de/archives/2006/08/21/generate-applicationxml-from-ivyxml-for-packaging-an-ear/#comments</comments>
		<pubDate>Mon, 21 Aug 2006 10:23:43 +0000</pubDate>
		<dc:creator>Philipp Meier</dc:creator>
		
		<category><![CDATA[java]]></category>

		<category><![CDATA[ant]]></category>

		<category><![CDATA[ear]]></category>

		<category><![CDATA[ivy]]></category>

		<category><![CDATA[j2ee]]></category>

		<guid isPermaLink="false">http://www.fnogol.de/archives/2006/08/21/generate-applicationxml-from-ivyxml-for-packaging-an-ear/</guid>
		<description><![CDATA[After a lot of trouble with maven 2 I tried ant with ivy as a build and dependency resolving system. For multi-project builds with ivy you&#8217;ll have to dig into the documentation and ivy samples a little deeper but finaly I must say I like it. One show stopper for me was that maven 2 [...]]]></description>
			<content:encoded><![CDATA[<p>After a lot of trouble with maven 2 I tried ant with <a href="http://www.jayasoft.org/ivy/">ivy</a> as a build and dependency resolving system. For multi-project builds with ivy you&#8217;ll have to dig into the documentation and ivy samples a little deeper but finaly I must say I like it. One show stopper for me was that maven 2 generated an application.xml from the pom. I use now a xslt stylesheet to make an application.xml from an ivy resolution report:</p>
<p class="code"><code>&lt;target name=&quot;appxml&quot; depends=&quot;resolve&quot;&gt;<br />
        &lt;property name=&quot;meta.dir&quot; value=&quot;${basedir}/src/main/resources/META-INF/&quot;/&gt;<br />
        &lt;property name=&quot;appxml.filename&quot; value=&quot;application.xml&quot;/&gt;<br />
        &lt;property name=&quot;appxml.file&quot; value=&quot;${build.dir}/${appxml.filename}&quot;/&gt;<br />
        &lt;ivy:report todir=&quot;${build.dir}&quot;<br />
                    outputpattern=&quot;ivy.xml&quot;<br />
                    xml=&quot;true&quot;/&gt;<br />
        &lt;xslt in=&quot;${build.dir}/ivy.xml&quot; style=&quot;ivy2appxml.xslt&quot; out=&quot;${appxml.file}&quot;/&gt;<br />
    &lt;/target&gt;</code></p>
<p>The stylsheet I use currently is simple but does it job. No support for web archvies and connectors yet, or any configuration but it&#8217;s doing it&#8217;s job:</p>
<p class="code">
<code>&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;<br />
                xmlns=&quot;http://java.sun.com/xml/ns/j2ee&quot;<br />
                xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;<br />
                xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/javaee/application_5.xsd&quot;&gt;<br />
    &lt;xsl:template match=&quot;ivy-report&quot;&gt;<br />
        &lt;application&gt;<br />
            &lt;display-name&gt;<br />
                &lt;xsl:value-of select=&quot;info/module&quot;/&gt;<br />
            &lt;/display-name&gt;<br />
            &lt;xsl:apply-templates/&gt;<br />
        &lt;/application&gt;<br />
    &lt;/xsl:template&gt;<br />
    &lt;xsl:template match=&quot;dependencies&quot;&gt;<br />
        &lt;xsl:apply-templates/&gt;<br />
    &lt;/xsl:template&gt;<br />
    &lt;xsl:template match=&quot;artifact[@type='jar']&quot;&gt;<br />
        &lt;module&gt;<br />
            &lt;java&gt;<br />
                &lt;xsl:value-of select=&quot;concat(@name, &#8216;.&#8217;, @ext)&quot;/&gt;<br />
            &lt;/java&gt;<br />
        &lt;/module&gt;<br />
    &lt;/xsl:template&gt;<br />
    &lt;xsl:template match=&quot;artifact[@type='ejb']&quot;&gt;<br />
        &lt;module&gt;<br />
            &lt;ejb&gt;<br />
                &lt;xsl:value-of select=&quot;concat(@name, &#8216;.&#8217;, @ext)&quot;/&gt;<br />
            &lt;/ejb&gt;<br />
        &lt;/module&gt;<br />
    &lt;/xsl:template&gt;<br />
    &lt;xsl:template match=&quot;artifact[@type='sar']&quot;&gt;<br />
        &lt;module&gt;<br />
            &lt;java&gt;<br />
                &lt;xsl:value-of select=&quot;concat(@name, &#8216;.&#8217;, @ext)&quot;/&gt;<br />
            &lt;/java&gt;<br />
        &lt;/module&gt;<br />
    &lt;/xsl:template&gt;<br />
&lt;/xsl:stylesheet&gt;</code><br />
</code></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/fnogol?a=kC_EcpqpsV0:Ogd70aBOkwA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=kC_EcpqpsV0:Ogd70aBOkwA:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/fnogol?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=kC_EcpqpsV0:Ogd70aBOkwA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=kC_EcpqpsV0:Ogd70aBOkwA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/fnogol?i=kC_EcpqpsV0:Ogd70aBOkwA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=kC_EcpqpsV0:Ogd70aBOkwA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/fnogol?i=kC_EcpqpsV0:Ogd70aBOkwA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=kC_EcpqpsV0:Ogd70aBOkwA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/fnogol?i=kC_EcpqpsV0:Ogd70aBOkwA:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.fnogol.de/archives/2006/08/21/generate-applicationxml-from-ivyxml-for-packaging-an-ear/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.fnogol.de/archives/2006/08/21/generate-applicationxml-from-ivyxml-for-packaging-an-ear/</feedburner:origLink></item>
		<item>
		<title>EJB 3.0 Annotations Cheat Sheet - Reference 1.2.2</title>
		<link>http://feedproxy.google.com/~r/fnogol/~3/PLq5h84g7Vg/</link>
		<comments>http://www.fnogol.de/archives/2006/05/29/ejb-30-annotations-cheat-sheet-reference-122/#comments</comments>
		<pubDate>Mon, 29 May 2006 12:01:27 +0000</pubDate>
		<dc:creator>Philipp Meier</dc:creator>
		
		<category><![CDATA[java]]></category>

		<category><![CDATA[cheat sheet]]></category>

		<category><![CDATA[ejb ejb3]]></category>

		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://www.fnogol.de/archives/2006/05/29/ejb-30-annotations-cheat-sheet-reference-122/</guid>
		<description><![CDATA[The sheet got it&#8217;s own url here.
Minor update: added @AssociationOverride from Java EE 5 API documentation. Thanks to Jonathan O&#8217;Connor for catching this one.
Just download it from here as pdf or OpenOffice Document.
]]></description>
			<content:encoded><![CDATA[<p>The sheet got it&#8217;s own url <a href="http://www.fnogol.de/ejb-annotations-cheat-sheat/">here</a>.</p>
<p>Minor update: added @AssociationOverride from Java EE 5 API documentation. Thanks to Jonathan O&#8217;Connor for catching this one.</p>
<p>Just download it from here as <a href="/media/ejb3.0-anno-cheat-1.2.2.pdf">pdf</a> or <a href="/media/ejb3.0-anno-cheat-1.2.2.sxw">OpenOffice Document</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/fnogol?a=PLq5h84g7Vg:A7QEMyiWPiM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=PLq5h84g7Vg:A7QEMyiWPiM:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/fnogol?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=PLq5h84g7Vg:A7QEMyiWPiM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=PLq5h84g7Vg:A7QEMyiWPiM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/fnogol?i=PLq5h84g7Vg:A7QEMyiWPiM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=PLq5h84g7Vg:A7QEMyiWPiM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/fnogol?i=PLq5h84g7Vg:A7QEMyiWPiM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=PLq5h84g7Vg:A7QEMyiWPiM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/fnogol?i=PLq5h84g7Vg:A7QEMyiWPiM:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.fnogol.de/archives/2006/05/29/ejb-30-annotations-cheat-sheet-reference-122/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.fnogol.de/archives/2006/05/29/ejb-30-annotations-cheat-sheet-reference-122/</feedburner:origLink></item>
		<item>
		<title>EJB 3.0 Annotations Cheat Sheet - Reference 1.2.1</title>
		<link>http://feedproxy.google.com/~r/fnogol/~3/lCceHRaQ714/</link>
		<comments>http://www.fnogol.de/archives/2006/05/02/ejb-30-annotations-cheat-sheet-121/#comments</comments>
		<pubDate>Tue, 02 May 2006 15:27:35 +0000</pubDate>
		<dc:creator>Philipp Meier</dc:creator>
		
		<category><![CDATA[java]]></category>

		<category><![CDATA[cheat sheet]]></category>

		<category><![CDATA[ejb]]></category>

		<category><![CDATA[ejb3]]></category>

		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://www.fnogol.de/archives/2006/05/02/ejb-30-annotations-cheat-sheet-121/</guid>
		<description><![CDATA[The sheet got it&#8217;s own url here.
Updates to the  EJB 3.0 Annotations Cheat Sheet. 
Changes

Title changed to EJB 2.1 and Ealier Client View
Update @RemoteHome and @LocalHome according to the latest spec.
Fixed spelling and typos (NamesQueries / SINGLE_TABLE)

Thanks to Jonathan O&#8217;Connor for pointing out this errors.
Just download it from here as pdf or OpenOffice Document. [...]]]></description>
			<content:encoded><![CDATA[<p>The sheet got it&#8217;s own url <a href="http://www.fnogol.de/ejb-annotations-cheat-sheat/">here</a>.</p>
<p>Updates to the  EJB 3.0 Annotations Cheat Sheet. </p>
<h3>Changes</h3>
<ul>
<li>Title changed to EJB 2.1 and Ealier Client View</li>
<li>Update @RemoteHome and @LocalHome according to the latest spec.</li>
<li>Fixed spelling and typos (NamesQueries / SINGLE_TABLE)</li>
</ul>
<p>Thanks to Jonathan O&#8217;Connor for pointing out this errors.</p>
<p>Just download it from here as <a href="/media/ejb3.0-anno-cheat-1.2.1.pdf">pdf</a> or <a href="/media/ejb3.0-anno-cheat-1.2.1.sxw">OpenOffice Document</a>. </p>
<p><img alt="Preview of (old) cheat sheet." src="http://www.fnogol.de/wp-content/ejb3.0annocheat1.0.png" /></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/fnogol?a=lCceHRaQ714:g_hNCc0FgrA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=lCceHRaQ714:g_hNCc0FgrA:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/fnogol?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=lCceHRaQ714:g_hNCc0FgrA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=lCceHRaQ714:g_hNCc0FgrA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/fnogol?i=lCceHRaQ714:g_hNCc0FgrA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=lCceHRaQ714:g_hNCc0FgrA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/fnogol?i=lCceHRaQ714:g_hNCc0FgrA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=lCceHRaQ714:g_hNCc0FgrA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/fnogol?i=lCceHRaQ714:g_hNCc0FgrA:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.fnogol.de/archives/2006/05/02/ejb-30-annotations-cheat-sheet-121/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.fnogol.de/archives/2006/05/02/ejb-30-annotations-cheat-sheet-121/</feedburner:origLink></item>
		<item>
		<title>Interruptible RMI - Working with JBoss?</title>
		<link>http://feedproxy.google.com/~r/fnogol/~3/EBwCbzFvNsc/</link>
		<comments>http://www.fnogol.de/archives/2006/04/24/interruptable-rmi-working-with-jboss/#comments</comments>
		<pubDate>Mon, 24 Apr 2006 12:07:39 +0000</pubDate>
		<dc:creator>Philipp Meier</dc:creator>
		
		<category><![CDATA[java]]></category>

		<category><![CDATA[ejb3]]></category>

		<category><![CDATA[jboss]]></category>

		<category><![CDATA[rmi]]></category>

		<guid isPermaLink="false">http://www.fnogol.de/archives/2006/04/24/interruptable-rmi-working-with-jboss/</guid>
		<description><![CDATA[Neil O&#8217;Toole has a RMI Socket- and ThreadFactory which enables a RMI client to interrupt a RMI invokation. This seems like a nice addition to a fat swing client which accesses a JBoss server. What I wonder is if the library will be compatible with JBoss and EJB 3. Have to try out. More information [...]]]></description>
			<content:encoded><![CDATA[<p>Neil O&#8217;Toole has a RMI Socket- and ThreadFactory which enables a RMI client to interrupt a RMI invokation. This seems like a nice addition to a fat swing client which accesses a JBoss server. What I wonder is if the library will be compatible with JBoss and EJB 3. Have to try out. More information available at <a href="http://weblogs.java.net/blog/neilotoole/archive/2006/04/rmi_interruptus.html">Neil&#8217;s blog entry</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/fnogol?a=EBwCbzFvNsc:ysvBw3jDWOI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=EBwCbzFvNsc:ysvBw3jDWOI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/fnogol?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=EBwCbzFvNsc:ysvBw3jDWOI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/fnogol?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=EBwCbzFvNsc:ysvBw3jDWOI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/fnogol?i=EBwCbzFvNsc:ysvBw3jDWOI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=EBwCbzFvNsc:ysvBw3jDWOI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/fnogol?i=EBwCbzFvNsc:ysvBw3jDWOI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/fnogol?a=EBwCbzFvNsc:ysvBw3jDWOI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/fnogol?i=EBwCbzFvNsc:ysvBw3jDWOI:gIN9vFwOqvQ" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.fnogol.de/archives/2006/04/24/interruptable-rmi-working-with-jboss/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.fnogol.de/archives/2006/04/24/interruptable-rmi-working-with-jboss/</feedburner:origLink></item>
	</channel>
</rss>
