<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Better Software and beyond... &#187; java</title>
	<atom:link href="http://www.thorsten-kamann.de/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thorsten-kamann.de</link>
	<description>About architecture, development, quality and more</description>
	<lastBuildDate>Tue, 25 Oct 2011 20:16:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Translate JIRA Transitions</title>
		<link>http://www.thorsten-kamann.de/2009/11/19/translate-jira-transitions/</link>
		<comments>http://www.thorsten-kamann.de/2009/11/19/translate-jira-transitions/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 17:20:25 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JIRA]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/wordpress/?p=249</guid>
		<description><![CDATA[<a href="http://www.thorsten-kamann.de/2009/11/19/translate-jira-transitions/" title="Translate JIRA Transitions"></a>If you are using the famous Issue tracker JIRA by Atlassian you are able to change the workflow. Workflows are used to define the status an issue can get. Between the 2 statuses there are a transition. In JIRA you &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2009/11/19/translate-jira-transitions/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.thorsten-kamann.de/2009/11/19/translate-jira-transitions/" title="Translate JIRA Transitions"></a><p>If you are using the famous <a href="http://www.atlassian.com/software/jira/" target="_blank">Issue tracker JIRA by Atlassian</a> you are able to change the workflow. Workflows are used to define the status an issue can get. Between the 2 statuses there are a transition. In JIRA you can translate the statuses (Administration | Status | Translate).</p>
<div class="img alignnone size-medium wp-image-250" style="width:300px;">
	<img src="http://www.thorsten-kamann.de/wordpress/wp-content/uploads/2009/11/jira_translate_statuses-300x282.jpg" alt="Translate statuses in JIRA" width="300" height="282" />
	<div>Translate statuses in JIRA</div>
</div>
<p>But for transitions there is not such a dialog. But there is an solution for this. You can modify the language property file. If you use an script you can do this automatically. But one step after another <img src='http://www.thorsten-kamann.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>1. Locate the language library</h3>
<p>In JIRA all language files are bundled in a library. This library you find in <em>WEB-INF/lib</em> in your JIRA installation.For the german translation the library is named <em>language_de_DE.jar</em>.</p>
<h3>2. Extract the JAR and edit the JiraWebActionSupport_de_DE.properties</h3>
<p>The <em>JiraWebActionSupport_de_DE.properties</em> is in the package <em>com/atlassian/jira/web/action</em>. You can edit this file with a simple editor. For every transititon you must add one or two properties:</p>
<ul>
<li>for the title</li>
<li>for the submit button, if you transition needs a dialog (e.g. the reopen issue has a dialog where you can leave a comment)</li>
</ul>
<p>For instance you have a transition Test Issue. This transition doesn&#8217;t need a dialog. So you need only one property:</p>
<pre>testissue.title=Testen</pre>
<p>As an exteded example you have a transition named Issue tested. For this you need a dialog the user can leave a comment. In this case you need 2 properties:</p>
<pre>issuetested.title=Getested
issuetested.submit=Test abschliessen</pre>
<p>After you finished the modification you can repackage the JAR.</p>
<h3>3. Restart JIRA</h3>
<p>This you should really do before you start with the next steps.</p>
<h3>4. Add the needed properties to the transitions</h3>
<p>The next step is to create a relation between JIRA and the properties. This can be done in the panel for modifying transitions (<em>Administration | Workflows | Steps (of the workflow you want to change) |¬† Click on the transition | Properties of the transition</em>). In the page loaded then you can add the needed properties.</p>
<div class="img alignnone size-medium wp-image-251" style="width:300px;">
	<img src="http://www.thorsten-kamann.de/wordpress/wp-content/uploads/2009/11/jira_add_properties_to_transitions-300x222.jpg" alt="Add properties to transitions" width="300" height="222" />
	<div>Add properties to transitions</div>
</div>
<p>What you need to add is a key-value pair. The key is for JIRA. With this key JIRA knows what kind of i18n text this property represents. The both relevant key are:</p>
<ul>
<li><em>jira.i18n.title</em> (for the title)</li>
<li><em>jira.i18n.submit</em> (for the submit button)</li>
</ul>
<p>As value you can add the properties you add to the language file (JiraWebActionSupport_de_DE.properties). After you are done you can close every dialog and activate the workflow.</p>
<p>As a result you see something similar to this:</p>
<div class="img alignnone size-full wp-image-252" style="width:213px;">
	<img src="http://www.bobdveloper.de/wp-content/uploads/2009/11/jira_translated_transition.jpg" alt="Translated Transition" width="213" height="99" />
	<div>Translated Transition</div>
</div>
<h3>Hmm&#8230;there are many steps&#8230;is there a chance to simplify this?</h3>
<p>Yes, of course. You can create a script to do this automatically. For example I have one written in Groovy doing all steps automatically:</p>
<pre lang="groovy">//Points to the language_de_DE.jar
def langPack = new File("...")

//Points to the folder the modified JAR should be copied to
def targetDir = new File("...")

//Points to the folder the langPack should be extracted to
def tempDir = new File(System.properties["java.io.tmpdir"]+"/language_pack")

def langFile = new File(tempDir, "com/atlassian/jira/web/action/JiraWebActionSupport_de_DE.properties")

//Create the antbuild for some common tasks
def ant = new AntBuilder()

if (tempDir.exists()){
    ant.delete(dir:tempDir)
}

ant.mkdir(dir:tempDir)
ant.unzip(src:langPack, dest:tempDir)

//Using Groovy's multiline strings
def t = """
issuetested.title=Getested
issuetested.submit=Getested
"""

//Append the existing content with our extended properties
langFile.text = langFile.text + t
ant.zip(basedir:tempDir, destfile:new File(targetDir, "language_de_DE.jar"))
ant.delete(dir:tempDir)

//Build JIRA
"cd /opt/jira".execute()
"build.bat".execute()

//Restart Tomcat
"cd /opt/tomcat/bin".execute()
"catalina.sh start".execute()</pre>
<p>With this simple script you can do all steps automatically. One thing isn&#8217;t really nice. The properties you append to the original languagge file are saved in the script. This should be changed if there are more than a handful properties.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2009/11/19/translate-jira-transitions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Domainobjects with Spring and AOP</title>
		<link>http://www.thorsten-kamann.de/2009/11/05/using-domainobjects-with-spring-and-aop/</link>
		<comments>http://www.thorsten-kamann.de/2009/11/05/using-domainobjects-with-spring-and-aop/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 12:05:40 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Publications]]></category>
		<category><![CDATA[AOP]]></category>
		<category><![CDATA[Domain Driven Design]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/wordpress/?p=243</guid>
		<description><![CDATA[<a href="http://www.thorsten-kamann.de/2009/11/05/using-domainobjects-with-spring-and-aop/" title="Using Domainobjects with Spring and AOP"></a>This article is about the managing of Domainobjects with the Spring Framework. Domainobjects are often initilized with the new keyword. This avoids the usage with Spring, because there aren&#8217;t Spring Beans. But with AOP and the @Configurable Annotation of Spring &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2009/11/05/using-domainobjects-with-spring-and-aop/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.thorsten-kamann.de/2009/11/05/using-domainobjects-with-spring-and-aop/" title="Using Domainobjects with Spring and AOP"></a><p>This article is about the managing of Domainobjects with the Spring Framework. Domainobjects are often initilized with the new keyword. This avoids the usage with Spring, because there aren&#8217;t Spring Beans. But with AOP and the @Configurable Annotation of Spring you can manage these objects too.</p>
<p>This article is in german and published at <a href="http://it-republik.de/jaxenter/" target="_blank">Jaxenter</a>.<br />
You will find them here: <a href="http://it-republik.de/jaxenter/artikel/Mit-Spring-und-AOP-Domaenenklassen-verwalten-2644.html" target="_blank">http://it-republik.de/jaxenter/artikel/Mit-Spring-und-AOP-Domaenenklassen-verwalten-2644.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2009/11/05/using-domainobjects-with-spring-and-aop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Groovy Pt. 1</title>
		<link>http://www.thorsten-kamann.de/2009/06/03/dynamic-groovy-part1/</link>
		<comments>http://www.thorsten-kamann.de/2009/06/03/dynamic-groovy-part1/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 22:34:03 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[MetaObjectProtocol]]></category>
		<category><![CDATA[MOP]]></category>
		<category><![CDATA[Test]]></category>
		<category><![CDATA[Unit]]></category>
		<category><![CDATA[Unittest]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/wordpress/?p=181</guid>
		<description><![CDATA[<a href="http://www.thorsten-kamann.de/2009/06/03/dynamic-groovy-part1/" title="Dynamic Groovy Pt. 1"></a>Certainly you know that Groovy is one of the dynamic languages published in the last years. There are some languages with this approach: Ruby, JRuby, Python, PHP, JavaScript and many more. Groovy is a little bit special if you are &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2009/06/03/dynamic-groovy-part1/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.thorsten-kamann.de/2009/06/03/dynamic-groovy-part1/" title="Dynamic Groovy Pt. 1"></a><p>Certainly you know that <a title="Groovy" href="http://groovy.codehaus.org" target="_blank">Groovy</a> is one of the dynamic languages published in the last years. There are some languages with this approach: <a title="Ruby" href="http://www.ruby-lang.org" target="_blank">Ruby</a>, <a title="JRuby" href="http://jruby.codehaus.org/" target="_blank">JRuby</a>, <a title="Python" href="http://www.python.org/" target="_blank">Python</a>, <a title="PHP" href="http://www.php.net/" target="_blank">PHP</a>, <a title="JavaScript" href="https://developer.mozilla.org/en/JavaScript" target="_blank">JavaScript</a> and many more.</p>
<p>Groovy is a little bit special if you are a Java-Developer. Groovy is built on the top of the <a title="Java" href="http://www.java.net" target="_blank">Java-Platform</a>. So it is easy to learn the concepts and syntax of this nice language. Aside of powerful syntax enhancements there are the dynamic approach. With the Meta Object Protocol (MOP) you are able to analyze and change every Object.</p>
<h3>Getting all properties of an Object</h3>
<p>Properties in Groovy are a little bit special. In difference to fields a property always have a Getter-/Setter-Method. It is very easy to get all of such properties:</p>
<pre lang="groovy">def someObject = new SomeJavaObject()
someObject.metaClass.getProperties().each{
    println it.name
}</pre>
<p>With this codefragment you get a list of all properties of the Object <span style="font-family: andale mono,times;">someObject</span>. The content of this list are <span style="font-family: andale mono,times;">groovy.lang.MetaBeanProperty</span>. With this class you can</p>
<ul>
<li>get and set the field</li>
<li>get and set the Getter and Setter separately</li>
<li>query for a special property</li>
</ul>
<p>You can see in Picture 1 the Classdiagram of the MetabeanProperty class. With the help of this class you can easily analyze and change existing Groovy classes.</p>
<div class="img alignnone size-full wp-image-194" style="width:434px;">
	<img src="http://www.bobdveloper.de/wp-content/uploads/2009/06/groovy_lang_metabeanproperty3.png" alt="groovy.lang.MetaBeanProperty" width="434" height="353" />
	<div>groovy.lang.MetaBeanProperty</div>
</div><br />
<strong>Picture 1: Classdiagram of <span style="font-family: andale mono,times;">groovy.lang.MetaBeanProperty</span></strong></p>
<h3>What is a MetaClass?</h3>
<p>Every Class has some meta informations. This are informations about fields, properties and methods. Additionally it exists an invokeMethod. This method is used to call dynamically methods of Groovy Classes. The behaviour of this method is similar to the Reflection mechnism of Java (you know the package <span style="font-family: andale mono,times;">java.lang.reflect</span>?).</p>
<p><strong><div class="img alignnone size-full wp-image-197" style="width:472px;">
	<img src="http://www.bobdveloper.de/wp-content/uploads/2009/06/groovy_lang_metaclass.png" alt="groovy.lang.MetaClass" width="472" height="373" />
	<div>groovy.lang.MetaClass</div>
</div><br />
</strong><strong>Picture 2: Classstructure of <span style="font-family: andale mono,times;">groovy.lang.MetaClass</span></strong></p>
<h3>Dynamically adding method to classes</h3>
<p>With the help of this class you are able to add new methods to an existing class. Even final (and immutable) classes could be extended:</p>
<pre lang="groovy" escaped="true">String.metaClass.toFirstUpper &lt;&lt; {
	delegate[0].toUpperCase() + delegate.substring(1)
}</pre>
<p>This little fragment adds one method to the final class java.lang.String. After this code is executed you can access this from your¬† Groovy Code. Please attend that this only works if you are calling the additional methods from Groovy. You cannot call it from your Java Code, because the Compiler doesn&#8217;t know anything of this additonally method. But you can use reflection with a simple invokeMethod to use the dynamically added method.</p>
<p>In Groovy you can use the new method directly:</p>
<pre lang="groovy">def myString = "thisIsASimpleString"
assert "ThisIsASimpleString" == myString.toFirstUpper()</pre>
<p>If you use Java you need to use Reflection</p>
<pre lang="java">String myString = "thisIsASimpleString";
Method m = String.class.getMethod("toFirstUpper", new Class[]{});
assert "ThisIsASimpleString" == m.invokeMethod(myString, new Object[]{});</pre>
<h3>Adding static methods</h3>
<p>This works for static methods, too.</p>
<pre escaped="true" lang="groovy">public class Customer{
   String firstName
   String lastName
}

Customer.metaClass.static.create &lt;&lt; { String first, String last -&gt;
    new Customer(firstName: first, lastName: last)
}

assert "Thorsten" == Customer.create("Thorsten", "Kamann").firstNam</pre>
<h3>Conclusion</h3>
<p>This was Part 1 of Dynamic Groovy. In the next part we see how to add dynamically add constructors, properties, and adding methods to interfaces.</p>
<h3>Links</h3>
<ul>
<li><a href="http://groovy.codehaus.org/ExpandoMetaClass+-+Methods" target="_blank">http://groovy.codehaus.org/ExpandoMetaClass</a></li>
<li><a href="http://groovy.codehaus.org/ExpandoMetaClass+-+Methods" target="_blank">http://groovy.codehaus.org/ExpandoMetaClass+-+Methods</a></li>
<li><a href="http://groovy.codehaus.org/ExpandoMetaClass+-+Static+Methods" target="_blank">http://groovy.codehaus.org/ExpandoMetaClass+-+Static+Methods</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2009/06/03/dynamic-groovy-part1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Vortragsreihe Dortmund 09.02.2009: Webtests reloaded &#8211; Webtests mit Selenium, TestNG, Groovy und Maven</title>
		<link>http://www.thorsten-kamann.de/2009/01/28/vortragsreihe-dortmund-09022009-webtests-reloaded-webtests-mit-selenium-testng-groovy-und-maven/</link>
		<comments>http://www.thorsten-kamann.de/2009/01/28/vortragsreihe-dortmund-09022009-webtests-reloaded-webtests-mit-selenium-testng-groovy-und-maven/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 21:19:46 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[Test]]></category>
		<category><![CDATA[TestNG]]></category>
		<category><![CDATA[Unit]]></category>
		<category><![CDATA[Unittest]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/wordpress/?p=93</guid>
		<description><![CDATA[<a href="http://www.thorsten-kamann.de/2009/01/28/vortragsreihe-dortmund-09022009-webtests-reloaded-webtests-mit-selenium-testng-groovy-und-maven/" title="Vortragsreihe Dortmund 09.02.2009: Webtests reloaded - Webtests mit Selenium, TestNG, Groovy und Maven"></a>Testgetriebene Entwicklung ist ein Muss, um die Qualität von Software-Produkten zu sichern. Der wohl am schwierigsten zu testenden Teil einer Anwendung ist die Weboberfläche. Oftmals ist es so, dass Oberflächen lediglich manuell getestet werden &#8211; mit allen Nachteilen, die manuelle &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2009/01/28/vortragsreihe-dortmund-09022009-webtests-reloaded-webtests-mit-selenium-testng-groovy-und-maven/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.thorsten-kamann.de/2009/01/28/vortragsreihe-dortmund-09022009-webtests-reloaded-webtests-mit-selenium-testng-groovy-und-maven/" title="Vortragsreihe Dortmund 09.02.2009: Webtests reloaded - Webtests mit Selenium, TestNG, Groovy und Maven"></a><p>Testgetriebene Entwicklung ist ein Muss, um die Qualität von Software-Produkten zu sichern. Der wohl am schwierigsten zu testenden Teil einer Anwendung ist die Weboberfläche. Oftmals ist es so, dass Oberflächen lediglich manuell getestet werden &#8211; mit allen Nachteilen, die manuelle Test mit sich bringen. Das Gespann Selenium, TestNG, Groovy und Maven bietet Ihnen einen Lösungsansatz, mit dem Sie in vertretbarer Zeit automatisierte Tests für Weboberflächen erstellen können. Dieser Vortrag führt Sie anhand einer Webanwendung Schritt für Schritt durch den Prozess, sodass Sie danach mit eigenen Experimenten beginnen können.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2009/01/28/vortragsreihe-dortmund-09022009-webtests-reloaded-webtests-mit-selenium-testng-groovy-und-maven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vortragsreihe Bonn 18.07.2008: My daily Spring &#8211; Best Practices mit Spring</title>
		<link>http://www.thorsten-kamann.de/2008/07/18/vortragsreihe-bonn-my-daily-spring-best-practices-mit-spring/</link>
		<comments>http://www.thorsten-kamann.de/2008/07/18/vortragsreihe-bonn-my-daily-spring-best-practices-mit-spring/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 20:44:31 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Test]]></category>
		<category><![CDATA[Unit]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/wordpress/?p=83</guid>
		<description><![CDATA[<a href="http://www.thorsten-kamann.de/2008/07/18/vortragsreihe-bonn-my-daily-spring-best-practices-mit-spring/" title="Vortragsreihe Bonn 18.07.2008: My daily Spring - Best Practices mit Spring"></a>In vielen Projekten ist das Spring-Framework das Mittel der Wahl. Zusätzlich werden in vielen Produkten Spring intern eingesetzt. Damit die Arbeit mit Spring uneingeschränkt Spass macht ist es wichtig einige Tricks und Kniffe zu kennen. In diesem Vortrag zeigt Ihnen &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2008/07/18/vortragsreihe-bonn-my-daily-spring-best-practices-mit-spring/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.thorsten-kamann.de/2008/07/18/vortragsreihe-bonn-my-daily-spring-best-practices-mit-spring/" title="Vortragsreihe Bonn 18.07.2008: My daily Spring - Best Practices mit Spring"></a><p>In vielen Projekten ist das <a id="amzn_cl_link_0" style="border-bottom: 1px solid; color: #aa3511; text-decoration: underline; padding-bottom: 1px;" name="0764574833" href="http://amazon.de/gp/product/0764574833?ie=UTF8&amp;tag=thorskaman-21&amp;link_code=em1&amp;camp=2510&amp;creative=11146&amp;creativeASIN=0764574833&amp;adid=0f832feb-cf5f-4e31-badb-c1927afb0c4d" target="_blank">Spring-Framework</a> das Mittel der Wahl. Zusätzlich werden in vielen Produkten Spring intern eingesetzt. Damit die Arbeit mit Spring uneingeschränkt Spass macht ist es wichtig einige Tricks und Kniffe zu kennen. In diesem Vortrag zeigt Ihnen der Referent, wie Sie effektiv Spring in Ihren Projekten einsetzen können. Die Themenbandbreite reicht dabei vom Tooling über Architekturthemen bis hin zum Testing:</p>
<ul>
<li>Spring-IDE: Features und Verwendung
<ul>
<li>Navigation zwischen Beandefinitionen und Code</li>
<li>Aspekte</li>
</ul>
</li>
<li>Architekturen unabhängig von Spring
<ul>
<li>keine HibernateTemplates</li>
<li>mein Code kennt nur Standards</li>
<li>eigene Annotations anstatt Spring-Annotations</li>
</ul>
</li>
<li>Testen mit Spring
<ul>
<li>Spring für Unittests</li>
<li>Dependency Injection</li>
<li>Angepasste Spring-Konfigurationen</li>
<li>DAO-Test</li>
</ul>
</li>
</ul>
<p><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=id=532860&amp;doc=mydailyspring-1217328085126960-9" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent" /><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=id=532860&amp;doc=mydailyspring-1217328085126960-9" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355" wmode="transparent"></embed></object></p>
<p><img id="kosa-target-image" style="position: absolute; visibility: hidden; z-index: 2147483647; left: 434px; top: 302px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAUCAYAAACJfM0wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAAB90RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgOLVo0ngAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDQvMDQvMDhrK9wWAAACA0lEQVQ4jbXVz0sUYRjA8e+u6xqlKJUaBZuUh6AfhyCEpUN/QIR0skMh6iHwsKe6lFu4HjpJhy5BS1CsZtDSrYMYdPHUZauDbhcpi7bEH2DOtjvP83aY3dFxxi1hfeAd3nlhPu/zPjPvOyHgKnsQEQDz60kaaKuTuRpqHxqMAKBWvVCoJOjAxqqj60Q1Y3fg05dWki/OMjt3+L+A+KklRvs+cia2VhtOTsYpN5wgl4nReTCM6s7o96UyA6kFkpNK9tZMEFx0B2bnO8hlYky/L5N9V2TDsinbgohi207fFqGxwZDoO0T67nEu9FseAyAMODWuNqC9LczUTBGrKIgqqgYRQdSgqogovy2b8YkCxzqiBBlOxuJ/earqIqqKbMfVsLYuGGMIMnb8KkTUk60HNwapTOqGCYLVDzdGDH9Km1mKiDOBMe4qmqJbl+g1wu5gtQGFZWHw8gFam/GXoILubwpxf+go336WCDJ8pYh35xkYayZ9J8aVi52+lZgt18VCif7RBeLd+X+XItX7nJHXyvkb6wD8eHOOqekVEuNffZM4icyR6s34SuGDTx/Jk715D4CTIy959XaFB0/n+Tw2TMu+jUDcMby3vg2yPW4/WuTxtYe0RJd9D9eKmodQT1eOxKVn9HR9qJZ1l3DABgGYuD7sdGR36CZsrFXqeNADhNijX9NfAyI+Sz1Sug0AAAAASUVORK5CYII=" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2008/07/18/vortragsreihe-bonn-my-daily-spring-best-practices-mit-spring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vortragsreihe Dortmund 14.04.2008: Unified Development Environments</title>
		<link>http://www.thorsten-kamann.de/2008/04/04/vortragsreihe-dortmund-14042008-unified-development-environments/</link>
		<comments>http://www.thorsten-kamann.de/2008/04/04/vortragsreihe-dortmund-14042008-unified-development-environments/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 21:28:34 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Development Process]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Test]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/wordpress/?p=97</guid>
		<description><![CDATA[<a href="http://www.thorsten-kamann.de/2008/04/04/vortragsreihe-dortmund-14042008-unified-development-environments/" title="Vortragsreihe Dortmund 14.04.2008: Unified Development Environments"></a>Große Entwicklungsabteilungen stehen oft vor dem Problem einheitlicher Entwicklungsprozesse und Werkzeuge. Nach einiger Zeit hat jedes Projekt eigene Prozesse und Werkzeuge etabliert. Dies ist nicht im Sinne der Entwicklungsabteilung. Softwaresysteme müssen i. d. R. über Jahre hinweg gewartet und erweitert &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2008/04/04/vortragsreihe-dortmund-14042008-unified-development-environments/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.thorsten-kamann.de/2008/04/04/vortragsreihe-dortmund-14042008-unified-development-environments/" title="Vortragsreihe Dortmund 14.04.2008: Unified Development Environments"></a><p>Große Entwicklungsabteilungen stehen oft vor dem Problem einheitlicher Entwicklungsprozesse und Werkzeuge. Nach einiger Zeit hat jedes Projekt eigene Prozesse und Werkzeuge etabliert. Dies ist nicht im Sinne der Entwicklungsabteilung. Softwaresysteme müssen i. d. R. über Jahre hinweg gewartet und erweitert werden &#8211; oft von einem Team, das sich neu in die Anwendung einarbeiten muss.<br />
Nicht selten stellt die Rekonstruktion der Entwicklungsumgebung einen erheblichen Aufwand dar.</p>
<p>Dieser Vortrag beschreibt &#8211; anhand eines Erfahrungsberichts &#8211; den Aufbau einer strukturierten Entwicklungsumgebung, die auch für grosse Entwicklungsabteilungen skaliert.</p>
<ul>
<li> Zentrale Projekt- und Codeverwaltung (ähnlich wie Sourceforge)</li>
<li>Buildmanagement mit Maven</li>
<li>Entwicklungswerkzeuge basierend auf Maven und Eclipse</li>
<li>Installierbare Teamserver mit Virtualisierungstechnologie für Continuous Integration</li>
</ul>
<p><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=id=527945&amp;doc=unified-development-environment-1216994299020088-8" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent" /><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=id=527945&amp;doc=unified-development-environment-1216994299020088-8" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355" wmode="transparent"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2008/04/04/vortragsreihe-dortmund-14042008-unified-development-environments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring and Annotations</title>
		<link>http://www.thorsten-kamann.de/2008/03/29/spring-and-annotations/</link>
		<comments>http://www.thorsten-kamann.de/2008/03/29/spring-and-annotations/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 22:16:32 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Posts]]></category>
		<category><![CDATA[Annotation]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JPA]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/wordpress/?p=15</guid>
		<description><![CDATA[<a href="http://www.thorsten-kamann.de/2008/03/29/spring-and-annotations/" title="Spring and Annotations"></a>The Spring-Framework is a non-invasive framework. This means you can develop pure POJOs without any dependencies to the framework. You don&#8217;t need implement any interface nor you need to extend any base classes. However there are a lot of useful &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2008/03/29/spring-and-annotations/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.thorsten-kamann.de/2008/03/29/spring-and-annotations/" title="Spring and Annotations"></a><p>The Spring-Framework is a non-invasive framework. This means you can develop pure POJOs without any dependencies to the framework. You don&#8217;t need implement any interface nor you need to extend any base classes. However there are a lot of useful classes and interfaces provided by Spring &#8211; do you know the HibernateTemplate? &#8211; so you can use them if you want but you aren&#8217;t forced to use them.</p>
<p>If you remember the Spring 1.x stream without use of these templates make it very difficult to implement DAOs. This is much better with Spring 2 and JPA. For now you need only to inject an EntityManager and use the methods of them. That&#8217;s very nice, because of the EntityManager is a class out of the JPA/EJB3 standard.</p>
<p>Since Spring 2 there are annotation support. Not only standardized annotations are supported. Spring provides his own annotations. This is not so nice, because the use of this annotations makes your PoJos depend on Spring.</p>
<p><span id="more-15"></span></p>
<h3>The Sample</h3>
<p>There are a sample project to this article. You can download it <a title="Download the sample" href="http://www.thorsten-kamann.de/files/samples/sping-annotations/spring-annotations.zip">here</a>. The sample is an Eclipse Project. You need at least 3 plugins to get the sample running:</p>
<ul>
<li>SpringIDE (<a title="SpringIDE" href="http://springide.org/updatesite" target="_blank">http://springide.org/updatesite</a>)</li>
<li>GroovyIDE (<a title="GroovyIDE" href="http://dist.codehaus.org/groovy/distributions/update/" target="_blank">http://dist.codehaus.org/groovy/distributions/update/</a>)</li>
<li>Maven Integration (<a title="Maven Integration" href="http://m2eclipse.sonatype.org/update/" target="_blank">http://m2eclipse.sonatype.org/update/</a>)</li>
</ul>
<p>Additional to these plugins it is recommend to install a native Maven from <a title="Apache Maven" href="http://maven.apache.org" target="_blank">http://maven.apache.org</a>. The embedded Maven of the Maven Integration sometimes have problems with Groovy-based tests. To enable another Maven Installation you can add it in the Preferences (<span style="font-family: courier new,courier;">Window -&gt; Preferences -&gt; Maven -&gt; Installations</span>). After you have prepared your Eclipse you can import the sample and run it with <span style="font-family: courier new,courier;">Run As -&gt; Maven install</span>.</p>
<h3>Spring and Annotations</h3>
<p>Spring supports a lot of annotations. Additional to the standard Java 6 annotations like (<span style="font-family: courier new,courier;">@Resource</span>, <span style="font-family: courier new,courier;">@PostConstruct</span>, <span style="font-family: courier new,courier;">@PreDestroy</span>,&#8230;) there are a number of Spring-Annotations:</p>
<ul>
<li>@Autowired &#8211; injets a resource byType or byName</li>
<li>@Required &#8211; marks a property as mandatory</li>
<li>@Component &#8211; marks a class as Component. This you need for <span style="font-family: courier new,courier;">@Resource</span>, <span style="font-family: courier new,courier;">@Autowired</span></li>
<li>@Service &#8211; similar to <span style="font-family: courier new,courier;">@Component</span></li>
<li>@Controller &#8211; marks a class as Controller for <a title="SpringMVC" href="http://static.springframework.org/spring/docs/2.0.x/reference/mvc.html" target="_blank">SpringMVC</a></li>
<li>&#8230;</li>
</ul>
<p>If you want to use dependency injection with annotations you can</p>
<pre lang="java">package testprojects.spring.annotations;

import javax.annotations.Resource;

public class Demo{
  @Resource(name="otherResource")
  private Other resource;
}</pre>
<p>In this case the Java field named with resource should get a reference to another bean with the symbolic name otherResource. To get this work you must define a bean with this symbolic name:</p>
<pre lang="java">import org.springframework.stereotype;

@Component("otherResource")
public class Other{}</pre>
<p>Now we have configured our classes with annotations. But Spring doesn&#8217;t know that he should scan our classes for annotations. This we can do with the element <span style="font-family: courier new,courier;">context:component-scan</span> in an <span style="font-family: courier new,courier;">applicationContext.xml</span>:</p>
<p>At the start of the ApplicationContext of Spring all classes in the package <span style="font-family: courier new,courier;">testprojects.spring.annotations</span> will be scanned for annotations. If Spring found any the context will be build &#8211; similar to the <span style="font-family: courier new,courier;">XmlApplicationContext</span></p>
<p>.</p>
<h3>The Problem</h3>
<p>If you take a closer look at the class <span style="font-family: courier new,courier;">Other </span>you will see the import of¬† <span style="font-family: courier new,courier;">org.springframework.stereotype</span>. This will make the class depend to the Spring Framework. Thats very bad, because we won&#8217;t have such a dependency. But what we can do?  The solution is quite simple. Let us define our own annotation for this case and re-configure Spring in that way that our annotation instead teh Spring one will be used to mark classes as <span style="font-family: courier new,courier;">Components</span>.  The definition of the annotation is simple and a one-to-one copy of the original annotation provided by Spring:</p>
<pre lang="java">package testprojects.spring.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.stereotype.Repository;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Component {

  /**
  * The value may indicate a suggestion for a logical component name, to be
  * turned into a Spring bean in case of an autodetected component.
  *
  * @return the suggested component name, if any
  */
  String value() default "";
}</pre>
<p>The next step is to tell Spring that he doesn&#8217;t use its own <span style="font-family: courier new,courier;">@Component</span>-Annotation but our annotation. This can do with the <span style="font-family: courier new,courier;">context:component-scan</span> element, too:</p>
<p>The important changes are the attribute<span style="font-family: courier new,courier;"> use-default-filters</span>. If you set this to false, Spring ommit his own annotations. In this case you can define you own annotation classes with the c<span style="font-family: courier new,courier;">ontext:include-filter</span> element.</p>
<h3>And now&#8230; a sample</h3>
<p>Now we want it get together. To demonstrate the mechnism we want to create an own Annotation as replacement for the Spring @Service-Annotation. Then we mark a PoJo with this annotation and write a Unittest to verify that Spring use this class as Spring-Bean.</p>
<h4>1. Create the Service-Annotation</h4>
<pre lang="java">package testprojects.spring.annotations.Service;

@Target( { ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface MyService {

  /**
  * The value may indicate a suggestion for a logical component name, to be
  * turned into a Spring bean in case of an autodetected component.
  *
  * @return the suggested component name, if any
  */
  String value() default "";
}</pre>
<h4>2. Add this annotation to our class</h4>
<pre lang="java">import testprojects.spring.annotations.Service;

@MyService
public class ServiceBean {

}</pre>
<h4>3. Re-configure Spring to use the @MyService-Annotation</h4>
<pre lang="xml">&lt;beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:context="http://www.springframework.org/schema/context"
   xmlns:p="http://www.springframework.org/schema/p"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
   http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"&gt;

   &lt;context:component-scan
     base-package="testprojects.spring.annotations" use-default-filters="false"&gt;
     &lt;context:include-filter
         expression="testprojects.spring.annotations.Service"
         type="annotation" /&gt;
    &lt;/context:component-scan&gt;
&lt;/beans&gt;</pre>
<h4>4. Write a Unittest to verify that Spring is using the annotated class as SpringBean</h4>
<pre lang="groovy">@RunWith(SpringJUnit4ClassRunner)
@ContextConfiguration
public class ServiceAnnotationTest{

  @Autowired
  ServiceBean serviceBean

  @Test
  final void testServiceAnnotation(){
    Assert.assertNotNull(serviceBean)
  }
}</pre>
<p>bcbcbc</p>
<p><img id="kosa-target-image" style="position: absolute; visibility: hidden; z-index: 2147483647; left: 44px; top: 2361px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAUCAYAAACJfM0wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAAB90RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgOLVo0ngAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDQvMDQvMDhrK9wWAAACMElEQVQ4ja3SP2gTcRQH8O8vvUtIGmkqTY3SaMVFz6KDW2ywg4s4dGgXp3SyVLIIthCKQxCCuoZaXaSO/ilKd4sSdXRL0EWtIRYaSkXsJTH33utwSZM01xo0D353v+N+97l33/upQCAwFgwGfehiFYtFUxsYGPCmUqmv3YQTicSwBgCapnXTBQBoSinout5VVCnVDr/44B/OZH0xs6KMThCfR3LRs+aTycjvbwfCmawvduZkn7EwN4TBfheY90fXN6uYuffdyGQRu3apkmyDmzM2K8pYmBvC6kcLK+/KMEsWLCIQMSyLULUIFhH0HsGNycNYnDuO6PRno9lQSsFVh+tDQSEY6MHymzJKFQILgxkgYhALmBnMDLNsIf1sA8cG3VDYYzhFAWWfRBjCAiIbIxYQE1ga17+2GSICKLQYznCtiATEDK6BIrU5MUhgd0+NH+AIt+5jshdqgkpVwEwNkBgs9lyE4XY3nnLMWNf13QEAG1uE2JVe9PUC5JCvCMPrVpifOor1YnW34/pw7NjvVbmZ+3ljcTaMq5EjbRFJ07Gw8QfTd9fg96rc3o7bMh4f9SytvDenLl7/ZADAl5cjWF7dwmy60PaSeiPjo56lv2Ycnzi0Fp9AEgAu39x8+urtT9x5/GP74a2++LlTuumo76kDd4W9ALj9qIDIiOfBhdO+jtB9O279TFcuet77fD7Wn+sU7ajj1+kTSccb/wv/aymloEKh0Fg4HPZ2E87n86Udvs4FoWqwSHUAAAAASUVORK5CYII=" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2008/03/29/spring-and-annotations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create an Installer with IZPAck</title>
		<link>http://www.thorsten-kamann.de/2006/07/08/create-an-installer-with-izpack/</link>
		<comments>http://www.thorsten-kamann.de/2006/07/08/create-an-installer-with-izpack/#comments</comments>
		<pubDate>Sat, 08 Jul 2006 20:49:24 +0000</pubDate>
		<dc:creator>thorque</dc:creator>
				<category><![CDATA[Publications]]></category>
		<category><![CDATA[IZPack]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.thorsten-kamann.de/wordpress/?p=153</guid>
		<description><![CDATA[<a href="http://www.thorsten-kamann.de/2006/07/08/create-an-installer-with-izpack/" title="Create an Installer with IZPAck"></a>Javamagazin 03/06 PDF-File Create an Installer with IZPack (German) After you have finished your product you must packaging your software in a format to transport it to your customers. An archive (e.g. ZIP) is not the best format. For such &#8230;<p class="read-more"><a href="http://www.thorsten-kamann.de/2006/07/08/create-an-installer-with-izpack/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.thorsten-kamann.de/2006/07/08/create-an-installer-with-izpack/" title="Create an Installer with IZPAck"></a><div class="entry">
<h5>Javamagazin 03/06</h5>
<div class="img alignnone size-full wp-image-136" style="width:34px;">
	<img src="http://www.bobdveloper.de/wp-content/uploads/2009/05/pdf.gif" alt="PDF-File" width="34" height="34" />
	<div>PDF-File</div>
</div><a href="http://www.bobdveloper.de/wp-content/uploads/2009/05/jm-3_06-95_99.pdf">Create an Installer with IZPack (German)</a></p>
<p>After you have finished your product you must packaging your software in a format to transport it to your customers. An archive (e.g. ZIP) is not the best format. For such a packaging an installer is a good way. This article describes how to create such an installer with the OpenSource IZPack.</p>
<p>This article is written in german.</p>
<h3>Mit IZPack ein Installationsprogramm erstellen</h3>
<p>Sie haben eine Anwendung entwickelt und alle Tests wurden erfolgreich absolviert. Jetzt stellt sich die Frage, wie man die Anwendung am besten verteilt. Eine Möglichkeit ist es, die Binaries einfach zu zippen und das Archiv zum Download freizugeben. Dies ist aber oftmals nicht ausreichend. Also muss ein Installationsprogramm her. Dieser Workshop führt Sie durch die notwendigen Schritte, um ein solches Programm zu erstellen, das kommerziellen Lösungen in nichts nachsteht.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.thorsten-kamann.de/2006/07/08/create-an-installer-with-izpack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

