<?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>Alexander Holbreich&#187; Software Engineering &amp; Architecture</title> <atom:link href="http://alexander.holbreich.org/category/it-architecture/feed/" rel="self" type="application/rss+xml" /><link>http://alexander.holbreich.org</link> <description>Everything becomes a little different as soon as it is spoken out loud.  ~Hermann Hesse</description> <lastBuildDate>Wed, 01 Feb 2012 22:44:21 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Building Eclipse Rich Client Application automatically (Tycho)</title><link>http://alexander.holbreich.org/2012/02/eclipse-tycho-build/</link> <comments>http://alexander.holbreich.org/2012/02/eclipse-tycho-build/#comments</comments> <pubDate>Wed, 01 Feb 2012 22:44:21 +0000</pubDate> <dc:creator>shuron</dc:creator> <category><![CDATA[SCM]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Software Engineering & Architecture]]></category> <category><![CDATA[automation]]></category> <category><![CDATA[buildmanagement]]></category> <category><![CDATA[ci]]></category> <category><![CDATA[eclipse application]]></category> <category><![CDATA[jenkins]]></category> <category><![CDATA[life game]]></category> <category><![CDATA[maven]]></category> <category><![CDATA[rcp]]></category> <category><![CDATA[scm]]></category> <category><![CDATA[tycho]]></category><guid isPermaLink="false">http://alexander.holbreich.org/?p=1083</guid> <description><![CDATA[This post is attended to everyone who is creating Java applications with Eclipse Rich Client Platform. This article describes a working tycho configuration on working project (demo) project. That project can be build fully automatically with tycho on your CI server e.g. Jenkins. If you have developed Eclipse RCP, you maybe also come to the [...]]]></description> <content:encoded><![CDATA[<p>This post is attended to everyone who is creating Java applications with Eclipse Rich Client Platform.<a href="http://alexander.holbreich.org/wp-content/uploads/2012/02/tycho-logo.png?4c9b33"><img src="http://alexander.holbreich.org/wp-content/uploads/2012/02/tycho-logo.png?4c9b33" alt="" title="tycho-logo" width="150" height="147" class="alignright size-full wp-image-1131" style="margin: 5px;"/></a> This article describes a working tycho configuration on working project (demo) project. That project can be build fully automatically with tycho on your CI server e.g. Jenkins.<br /> If you have developed Eclipse RCP, you maybe also come to the conclusion that PDE-Build out of Eclipse IDE is not really an apropriate and stable way to build serious, production ready applications. But also automatization of PDE Build was not straightforward task, and a such is still not well documented (IMHO).<br /> Furthermore maybe you heard about some alternatives like <a href="http://wiki.eclipse.org/Building_an_RCP_application_with_hudson_%28Buckminster%29" target="_blank">buckminister approach</a> or athena. There is also a couple more approaches, but my focus yet is on tycho because i believe it has bright feature.<br /> So again this post describe kick stat tycho approache the next topic may cover, artifact repository, CI Server or, advanced tycho tasks, fill fre to comment&#8230;</p><h2>Tycho</h2><p>Let me introduce <a href="http://www.eclipse.org/tycho/" target="_blank">tycho</a> in few words here. Technically tycho is a set of maven plugins. But let it be said at the beginning, tycho tries to use all the eclipse PDE/JDT metadata first, everywhere it&#8217;s possible and therefore one of the goals of tycho project is to minimise configuraton duplication in maven artefacts. I try to show how this works on a working example.</p><p>But first here is the self-speaking list of tychos packaging types, i will covers here some of them more detailed.</p><ul><li><strong>eclipse-plugin</strong> result in Eclipse Plug-In bundle</li><li><strong>eclipse-test-plugin</strong> result in a test Plugin</li><li><strong>eclipse-feature</strong> wich eclipse feature as Result</li><li><strong>eclipse-application</strong> builds Eclipse Applicaton</li><li><strong>eclipse-repository</strong> builds repository an executables</li><li><strong>eclipse-update-site</strong> responisble for update-sites</li></ul><p>Tycho current release is 0.13.0 and is used in my example.<br /> <span id="more-1083"></span></p><h2>Example Application.</h2><p>In this article used applicaton is Open source and can be cloned from GitHub (<a href="https://github.com/shuron/lfgm" target="_blank">Shuron&#8217;s RCP Life Game</a>). This app is a very basic but working implementation of Conways Life Game. Technically it consist of: one parent project, one plugin project, one feature, as well as one target and a one repository projects. If you check that out, you will be able to start the game out of eclipse IDE by klicking on the &#8220;Launch Eclipse Application&#8221; Button in open <em>org.holbreich.lfgm.eclipse-repository/example.product</em> file.<br /> As you know an RCP application &#8220;have to&#8221; be build with some set of the eclipse platform plugins &#8211; target platform. That is where we start.</p><h3>Target platform</h3><p>The definition of the target platform in eclipse can be stored in file with file-extension <strong>.target</strong>. So my example target platform definition looks like following.</p><pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
&lt;?pde version=&quot;3.6&quot;?&gt;
&lt;target name=&quot;eclipse 3.7.1 (indigo)&quot; sequenceNumber=&quot;16&quot;&gt;
 &lt;locations&gt;
  &lt;location includeAllPlatforms=&quot;false&quot; includeMode=&quot;planner&quot; includeSource=&quot;false&quot; type=&quot;InstallableUnit&quot;&gt;
  &lt;unit id=&quot;org.eclipse.rcp.source.feature.group&quot; version=&quot;3.7.1.r37x_v20110729-9DB5FmNFnFLSFCtLxnRfMqt15A4A&quot;/&gt;
  &lt;unit id=&quot;org.eclipse.equinox.sdk.feature.group&quot; version=&quot;3.7.1.R37x_v20110907-7M7W8h8eNV4Vrz-hz01A7SL_MhZP&quot;/&gt;
  &lt;unit id=&quot;org.eclipse.pde.feature.group&quot; version=&quot;3.7.1.r37x_v20110810-0800-7b7qFVtFEx2XnmZ4jlM5mjM&quot;/&gt;
  &lt;repository location=&quot;http://download.eclipse.org/releases/indigo&quot;/&gt;
 &lt;/location&gt;
&lt;/locations&gt;
&lt;/target&gt;
</pre><p>Maven&#8217;s central project configuration file is pom.xml. The Element <em>build</em> of the pom.xml is a central element where all the needed (plugin) declarations are placed, so that maven is able to get the knowlege about how to compile and build desired artefacts. Typically you&#8217;ll find here the definition of needed maven plugins with their configurations, executions and goals. Please see <a href="http://maven.apache.org/pom.html#Plugins">pom.xml Reference</a> on detailed information on how it works toghether in maven.</p><p>The target platfrom which was mentioned abow is introduced to maven through mavens&#8217;s <a href="http://mojo.codehaus.org/build-helper-maven-plugin/" target="_blank">build-helper-maven-plugin</a> as an artifact. See the configuration section of that plugin.</p><pre class="brush: xml; title: ; notranslate">
 &lt;build&gt;
    &lt;plugins&gt;
       &lt;plugin&gt;
        &lt;!-- Id and version of build helper plugin --&gt;
	&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
        &lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt;
	&lt;version&gt;1.3&lt;/version&gt;
		&lt;executions&gt;
		&lt;execution&gt;
		  &lt;id&gt;attach-artifacts&lt;/id&gt;
		  &lt;phase&gt;package&lt;/phase&gt;
		  &lt;goals&gt;
			&lt;goal&gt;attach-artifact&lt;/goal&gt;
		  &lt;/goals&gt;
		  &lt;configuration&gt;
		        &lt;artifacts&gt;
                             &lt;artifact&gt;
				 &lt;file&gt;indigo.target&lt;/file&gt;
				 &lt;type&gt;target&lt;/type&gt;
				 &lt;classifier&gt;indigo&lt;/classifier&gt;
			     &lt;/artifact&gt;
		         &lt;/artifacts&gt;
		  &lt;/configuration&gt;
		&lt;/execution&gt;
		&lt;/executions&gt;
	&lt;/plugin&gt;
	&lt;/plugins&gt;
&lt;/build&gt;
</pre><p>Now our target platform can be used whenever we like and we would like to use it nearly everywhere, so that leads to the idea to provide this last configuration only once in the parent pom.xml of the maven parent project for the whole Life Game Application.</p><h3>Parent project</h3><p>A <em>parent project</em> is a maven way to handle a kind of configuration inheritance. My so called parent project defines some usefull and multiply used things for all of the modules used in the current application and also provides me the ability to build the whole application at once. Let me show you the whole file here, excuse me if it appears a bit unreadable now.</p><pre class="brush: xml; title: ; notranslate">
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 

http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;

  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;org.holbreich.lfgm&lt;/groupId&gt;
  &lt;artifactId&gt;parent&lt;/artifactId&gt;
  &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;pom&lt;/packaging&gt;
  &lt;name&gt;Shuron's Life Game Maven Parent Project&lt;/name&gt;

  &lt;properties&gt;
    &lt;!-- just some properties, tycho version and encoding --&gt;
  &lt;tycho-version&gt;0.13.0&lt;/tycho-version&gt;
		&lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
&lt;!-- eclipse IDE flat project style. So parent project is only sibling folder
   therefore has to acces his modules by &quot;../&quot;. Here are all the child modules. --&gt;
	&lt;modules&gt;
		&lt;module&gt;../org.holbreich.lfgm&lt;/module&gt;
		&lt;module&gt;../org.holbreich.lfgm.target&lt;/module&gt;
		&lt;module&gt;../org.holbreich.lfgm.feature&lt;/module&gt;
		&lt;module&gt;../org.holbreich.lfgm.eclipse-repository&lt;/module&gt;
	&lt;/modules&gt;

	&lt;build&gt;
		&lt;plugins&gt;
                  &lt;!-- defintion of tychos target-platform-configuration plugin --&gt;
			&lt;plugin&gt;
				&lt;groupId&gt;org.eclipse.tycho&lt;/groupId&gt;
				&lt;artifactId&gt;target-platform-configuration&lt;/artifactId&gt;
				&lt;version&gt;${tycho-version}&lt;/version&gt;
				&lt;configuration&gt;
					&lt;resolver&gt;p2&lt;/resolver&gt;
					&lt;target&gt;
                            &lt;!--  A reference to target platform artefact: --&gt;
						&lt;artifact&gt;
							&lt;groupId&gt;org.holbreich.lfgm&lt;/groupId&gt;
							&lt;artifactId&gt;target-platform&lt;/artifactId&gt;
							&lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
							&lt;classifier&gt;indigo&lt;/classifier&gt;
						&lt;/artifact&gt;
					&lt;/target&gt;
					&lt;ignoreTychoRepositories&gt;true&lt;/ignoreTychoRepositories&gt;
                           &lt;!-- Environment configuration for the taget platform --&gt;
					&lt;environments&gt;
						&lt;environment&gt;
							&lt;os&gt;win32&lt;/os&gt;
							&lt;ws&gt;win32&lt;/ws&gt;
							&lt;arch&gt;x86&lt;/arch&gt;
						&lt;/environment&gt;
						&lt;environment&gt;
							&lt;os&gt;linux&lt;/os&gt;
							&lt;ws&gt;gtk&lt;/ws&gt;
							&lt;arch&gt;x86&lt;/arch&gt;
  						&lt;/environment&gt;
					&lt;/environments&gt;
				&lt;/configuration&gt;
			&lt;/plugin&gt;
                 &lt;!-- defintion of tycho-maven-plugin --&gt;
			&lt;plugin&gt;
				&lt;groupId&gt;org.eclipse.tycho&lt;/groupId&gt;
				&lt;artifactId&gt;tycho-maven-plugin&lt;/artifactId&gt;
				&lt;version&gt;${tycho-version}&lt;/version&gt;
				&lt;extensions&gt;true&lt;/extensions&gt;
			&lt;/plugin&gt;
		&lt;/plugins&gt;
	&lt;/build&gt;
&lt;/project&gt;
</pre><p>As already mentioned in the comments of the pom.xml that defines known modules and a set of plugins with their configuration, here actually two plugins:</p><ul><li>target-platform-configuraton &#8211; which refers to allready discussed target platform artifact and provides aditional environment configuration.</li><li>tycho-maven-plugin &#8211; which cdefines  addtional packaging types like eclipse-plugin and eclipse feature.</li></ul><p>That definition allows you to minimize pom.xml of the plugin&#8217;s and features self.</p><h3>Plug-in pom.xml</h3><p>As all used plugins are already defined in the parent, the actual the pom.xml file of the pluign project is pretty short and looks like this:</p><pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project
	xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 

http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;

	xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;
        xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
	&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
	&lt;artifactId&gt;org.holbreich.lfgm&lt;/artifactId&gt;
	&lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
	&lt;packaging&gt;eclipse-plugin&lt;/packaging&gt;
	&lt;!-- Parent reference --&gt;
	&lt;parent&gt;
    	 &lt;artifactId&gt;parent&lt;/artifactId&gt;
    	 &lt;groupId&gt;org.holbreich.lfgm&lt;/groupId&gt;
    	 &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
    	 &lt;relativePath&gt;../org.holbreich.lfgm.parent/pom.xml&lt;/relativePath&gt;
  	&lt;/parent&gt;
&lt;/project&gt;
</pre><p>And this is great, becuase in a larg application you will have much of the plugings with their simple pom files.<br /> You see the important moment is the reference to the parent and declaration of the packaging type <em>eclipse-plugin</em>. Eclipse Feature project uses <em>eclipse-feature</em> packaging target, but looks most the same, so i&#8217;m not showing it here.</p><h3>Repository</h3><p>And finally Repositoy Plugin come into play. It&#8217;s defines routines for the last assembly and packing of a product. Here i bring only the build element of the pom.xml file where the execution element of <strong>tycho-p2-director-plugin</strong> defines these two goals.</p><pre class="brush: xml; title: ; notranslate">
  &lt;build&gt;
	&lt;plugins&gt;
	&lt;plugin&gt;
		&lt;groupId&gt;org.eclipse.tycho&lt;/groupId&gt;
		&lt;artifactId&gt;tycho-p2-director-plugin&lt;/artifactId&gt;
		&lt;version&gt;${tycho-version}&lt;/version&gt;
		&lt;executions&gt;
			&lt;execution&gt;
				&lt;id&gt;materialize-products&lt;/id&gt;
				&lt;goals&gt;
					&lt;goal&gt;materialize-products&lt;/goal&gt;
				&lt;/goals&gt;
			&lt;/execution&gt;
			&lt;execution&gt;
				&lt;id&gt;archive-products&lt;/id&gt;
				&lt;goals&gt;
					&lt;goal&gt;archive-products&lt;/goal&gt;
				&lt;/goals&gt;
			&lt;/execution&gt;
		&lt;/executions&gt;
	&lt;/plugin&gt;
	&lt;/plugins&gt;
&lt;/build&gt;
</pre><p>Now here we are. I&#8217;v didn&#8217;t mentioned further eclipse artefacts like feature.xml or some.project, they stay as usual and musst work also whitout maven. You can start to buld your app by executing maven golas like <em>mvn clean install</em> or make this configuration in your CI.</p><h3>Build automatisation with Jenkins CI</h3><p>The showed configuration is ready for automation as it is. You can automate this e.g. very simple with a standard Jenkins maven job. Provide git chekout path, for all the projects and define e.g. <em>clean install</em> as maven goals for execution on parent project&#8217;s pom.xml in yout Jenkins Job.<br /> <a href="http://alexander.holbreich.org/wp-content/uploads/2012/01/jenkins1.gif?4c9b33"><br /> <img src="http://alexander.holbreich.org/wp-content/uploads/2012/01/jenkins1-150x150.gif?4c9b33" alt="" title="jenkins1" width="100" height="100" class="size-thumbnail wp-image-388 alignleft" style="margin: 5px; border-width:1px; border-style:solid;"/></a><a href="http://alexander.holbreich.org/wp-content/uploads/2012/01/jenkins.gif?4c9b33"><img src="http://alexander.holbreich.org/wp-content/uploads/2012/01/jenkins-150x150.gif?4c9b33" alt="" title="jenkins" width="100" height="100" class="aligncenter size-thumbnail wp-image-1120" style="margin: 5px; border-width:1px; border-style:solid;"/></a><a href="http://alexander.holbreich.org/wp-content/uploads/2012/02/jenkins2.gif?4c9b33"><img src="http://alexander.holbreich.org/wp-content/uploads/2012/02/jenkins2-150x150.gif?4c9b33" alt="" title="jenkins2" width="100" height="100" class="alignnone size-thumbnail wp-image-1135" style="margin: 5px; border-width:1px; border-style:solid;"/></a></p><p>However zipped standalone executables for Linux and Windows can be found under org.holbreich.lfgm.eclipse-repository/target/products/ in the project workspace after sucessfull build. Have fun and let me know if you missed something i this description.</p><h3>Further questions</h3><p>This post was supposed to give you first motivation to try tycho on your own project and of course not all the aspects of the tycho build are covered here. I think following aspects are good topics for a discussion and future articles:</p><ul><li> Release configuration and management is e.g. a topic for itsself and is straght-forward maven relase.</li><li> Eclipse  Test Plugin</li><li> Code qulity with maven: Ceckstyle, PMD, corbetrura &#038; Co</li><li> Eclipse repository and update-side management</li><li> More maven best practices</li></ul><p>Let me know if something of the abow topic is something of your interesst.<br /> <strong>As well you are invited to comment your solutions and best practices</strong>.</p><h4>Further Readings</h4><ul><li><a href="http://wiki.eclipse.org/Tycho/Reference_Card">Tycho reference card</a></li><li><a href="http://maven.apache.org/guides/getting-started/index.html">Maven getting started</a></li><li><a href="http://maven.apache.org/pom.html">Maven POM-file reference</a></li><li><a href="http://wiki.eclipse.org/Tycho/Packaging_Types">Tycho package Types</a></li></ul><p>Tank you for reading if you got here <img src="http://alexander.holbreich.org/wp-includes/images/smilies/icon_wink.gif?4c9b33" alt=';)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://alexander.holbreich.org/2012/02/eclipse-tycho-build/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Installing Java 7 on Debian</title><link>http://alexander.holbreich.org/2011/11/java-7-on-debian/</link> <comments>http://alexander.holbreich.org/2011/11/java-7-on-debian/#comments</comments> <pubDate>Wed, 09 Nov 2011 20:15:44 +0000</pubDate> <dc:creator>shuron</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[setup]]></category><guid isPermaLink="false">http://alexander.holbreich.org/?p=962</guid> <description><![CDATA[Here is just an example of how to install java 7 on your linux. I use current Debian and oracle (former sun) java 7. First i had to download the latest java from oracle site and then extrat it. I have to do it because at the moment the is no official debain package for [...]]]></description> <content:encoded><![CDATA[<pre>Here is just an example of how to install java 7 on your linux.
I use current Debian and oracle (former sun) java 7.

First i had to download the latest java from oracle site and then extrat it. I have to do it because at the moment the is no official debain package for java 7.
So we are not able to do it with <em>apt-get</em> as we can it for <a href="http://alexander.holbreich.org/2010/01/java-jboss-debian-linux/">java 6</a>.</pre><p><span id="more-962"></span></p><pre class="brush: bash; title: ; notranslate">
wget http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz
tar zxvf jdk-7-linux-x64.tar.gz -C /usr/lib64/jvm/
</pre><p>Then we have to do some configuration.<br /> Debian Linux has useful script to maintain different version of one programs like <em>java</em> called <a href="http://linux.die.net/man/8/update-alternatives">update-altenatives</a>. So i simply use this.</p><pre class="brush: bash; title: ; notranslate">
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0/bin/java 1065
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0/bin/javac 1065
</pre><p>Where <em>1065</em> is a given priority.</p><p>To check my installation i use <em>&#8211;config </em>paramter</p><pre class="brush: bash; title: ; notranslate">
update-alternatives --config java
#this prints:
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                      Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/jdk1.7.0/bin/java             1065      auto mode
  1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
  2            /usr/lib/jvm/jdk1.7.0/bin/java             1065      manual mode&lt;/pre&gt;
</pre><p>And because 1065 is higher than 1061, the fresh installed java 7 will be used by default on my machine</p><pre class="brush: bash; title: ; notranslate">
java -version
#prints:
java version &quot;1.7.0&quot;
 Java(TM) SE Runtime Environment (build 1.7.0-b147)
 Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
</pre><p>Hope this save somebody some setup time.</p> ]]></content:encoded> <wfw:commentRss>http://alexander.holbreich.org/2011/11/java-7-on-debian/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>Favorite Eclipse UML Plugin</title><link>http://alexander.holbreich.org/2011/08/favorite-eclipse-uml-plugin/</link> <comments>http://alexander.holbreich.org/2011/08/favorite-eclipse-uml-plugin/#comments</comments> <pubDate>Sun, 21 Aug 2011 21:06:00 +0000</pubDate> <dc:creator>shuron</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[Personal]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Software Engineering & Architecture]]></category> <category><![CDATA[architectural details]]></category> <category><![CDATA[class diagram]]></category> <category><![CDATA[eclipse]]></category> <category><![CDATA[eclipse ide]]></category> <category><![CDATA[ide]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[Plugin]]></category> <category><![CDATA[reverse engineering]]></category> <category><![CDATA[uml]]></category><guid isPermaLink="false">http://alexander.holbreich.org/?p=957</guid> <description><![CDATA[What is your favorite Free or Open-Source UML Plug-in? Every year i try some of them and  remove them after few hours. As i remember, they where resource-hungry or just bad in reverse engineering Some weeks ago i tried ObjectAid UML Explorer Class Diagram and liked it. It could quick and easy create simple class [...]]]></description> <content:encoded><![CDATA[<p>What is your favorite Free or Open-Source UML Plug-in?</p><p>Every year i try some of them and  remove them after few hours. As i remember, they where resource-hungry or just bad in reverse engineering</p><p>Some weeks ago i tried <a href="http://www.objectaid.com/class-diagram">ObjectAid UML Explorer Class Diagram</a> and liked it. It could quick and easy create simple class Diagrams &#8211; just by Drag &amp; Drop. And i had no problems with static constructors or inner classes and other stuff in the code which causes problems to another Plug-ins.</p><p>Unfortunately Object Aid Sequence Diagram are not free but cost not much for private usage. Maybe i&#8217;ll try it soon.</p><p><strong>But first i would ask you what is your favorite Eclipse IDE Plug-in for fast and easy (e.g. partly) revers engineered UML diagrams which can be used to show some architectural details to your colleagues?</strong></p><p>Thank you for comments!</p> ]]></content:encoded> <wfw:commentRss>http://alexander.holbreich.org/2011/08/favorite-eclipse-uml-plugin/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>GIT</title><link>http://alexander.holbreich.org/2011/02/git/</link> <comments>http://alexander.holbreich.org/2011/02/git/#comments</comments> <pubDate>Sat, 26 Feb 2011 12:12:20 +0000</pubDate> <dc:creator>shuron</dc:creator> <category><![CDATA[linux]]></category> <category><![CDATA[Personal]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Software Engineering & Architecture]]></category> <category><![CDATA[git]]></category> <category><![CDATA[git-core]]></category> <category><![CDATA[setup]]></category> <category><![CDATA[source control]]></category> <category><![CDATA[source versioning]]></category> <category><![CDATA[tutorial]]></category><guid isPermaLink="false">http://alexander.holbreich.org/?p=765</guid> <description><![CDATA[I want to share with you some thoughts on GIT because I think that was a right invention to the right time and place. (This article should be finished half year ago right after i wrote , but unfortunatelly i didn&#8217;t find any time to finish it untill now.) Motivation My first version control system [...]]]></description> <content:encoded><![CDATA[<p>I want to share with you some thoughts on GIT because I think that was a right invention to the right time and place.</p><p><em>(This article should be finished half year ago right after i wrote </em><a href="http://alexander.holbreich.org/2010/11/subversion-on-debian-linux/"><em>about svn server installation</em></a><em>, but unfortunatelly i didn&#8217;t find any time to finish it untill now.)</em></p><h2>Motivation</h2><p><img class="alignleft" style="margin: 10px 15px;" title="Git Logo by by Henrik Nyh" src="http://henrik.nyh.se/uploads/git-logo.png" alt="" width="97" height="188" />My first version control system (VCS) was CVS and i used it with eclipse 2.0 for programming in java. I found CVS quite impressive and liked it a lot. It was also quite reliable and moderatelly fast.<br /> Then someone at the university told us to use SVN, because it has &#8220;plenty&#8221; of advantages. Somehow i found SVN not bad even if the eclipse svn plugin quality was never quite good. However SVN matured  and became powerful source control system and many many people and companies started using it. I think it&#8217;s the most used version control system.</p><p>I like SVN for easy branching and tagging (with good eclipse plugin support), for global version numbers, for understanding &#8220;http://&#8221; (with Web-Dav) as well as for more comfortable managing tools and <a href="http://alexander.holbreich.org/2010/11/subversion-on-debian-linux/"> easy installation and configuration</a>.</p><p>But that&#8217;s all what i like&#8230; There is no more practical advantages over CVS and moreover there are even some disadvantages also in comparison to cvs.</p><ul><li>SVN is slow and double slow over HTTP. It may not be critical if you do your changes on several files and them commits &#8216;em. I&#8217;m doing so in my  java project and it&#8217;s ok. But there could be also other scenarios e.g. if you deal with such &#8220;monsters&#8221; like <a href="http://alexander.holbreich.org/tag/magento/">magento</a>, performance gain very fast on importance <img src="http://alexander.holbreich.org/wp-includes/images/smilies/icon_wink.gif?4c9b33" alt=';)' class='wp-smiley' /></li><li>Folder movement is a nightmare. With the subversion you have to know what you do when you start move around your folders. <img src="http://alexander.holbreich.org/wp-includes/images/smilies/icon_wink.gif?4c9b33" alt=';)' class='wp-smiley' /></li><li>Ugly <em>.svn</em> folders in the folder tree of your project. O course cvs had them too. But do we really need them? Sometimes i just wanna to copy my project tree without that stuff.</li><li>Not closed connection (don&#8217;t know if it is an server or eclipse plugin bug). Sometimes svn commits leave not closed connection. Eclipse hangs. <img src="http://alexander.holbreich.org/wp-includes/images/smilies/icon_sad.gif?4c9b33" alt=':(' class='wp-smiley' /></li><li>SVN consumesa lot of space, more than cvs local and on the server.</li><li>You need to be online if you want to commit.</li></ul><p>All of these disadvantages i mentioned above are fixed in GIT. Git is much faster, flexible. So let  install it!<span id="more-765"></span></p><h2>Installation</h2><p>We start with installing the git-core component from linux (debian in my case) public repositories.</p><pre class="brush: bash; title: ; notranslate">
$ apt-get update
$ apt-get install git-core
</pre><p>After executing of these commands, which takes only approx. 2 seconds. you have installed the git-core on your machine. So now you can test it by checking the version or common commands list</p><pre class="brush: bash; title: ; notranslate">
$ git --version
# Returns e.g.:  git version 1.5.6.5
$ git
# Returns usage options
</pre><p>First good thing to do after a fresh git installation is to define some global properties:</p><pre class="brush: bash; title: ; notranslate">
$ git config --global user.name &quot;Alexander Holbreich&quot;
$ git config --global user.email &quot;alexander@xxxxx.org&quot;
$ git config --global color.status auto
$ git config --global color.branch auto
</pre><p>There are also more properties and configuration possibilities for git. But for normal usage you will never need them. If you think different see <a href="http://www.kernel.org/pub/software/scm/git/docs/git-config.html">git config manual</a>.</p><p>Normally you will be ready with git installation now.</p><h2>Usage (Remote repositories)<img class="alignright" style="margin: 10px 15px;" title="GitWeb Logo" src="https://git.wiki.kernel.org/images-git/c/cc/Git-logo-jengelh.png" alt="" width="200" height="80" /></h2><p>First you should think about your branching model. Start by<a href="http://nvie.com/posts/a-successful-git-branching-model/"> nvie model</a>. It looks  a bit complicated, but it covers nearly every aspect in big project work.  In an agile team such an approach is very easy maintained by git. See also related <a href="http://stackoverflow.com/questions/2621610/what-git-branching-models-actually-work-the-final-question/dontfollow" target="_blank">Stackoverflow discussion</a>.</p><p>There is a lot of documentation <a href="http://gitref.org/dontfollow" target="_blank">on git usage</a> on the internet so it makes not much sense to cover everything here again. But if you was interested in installing git, maybe you plan to maintain new reposity, so let&#8217;s look at them.</p><p>Small teams maybe would prefer to work with one central repository (<a href="http://progit.org/book/de/ch5-2.html" target="_blank">centralized workflow</a>) for it is a common approach we know from svn and cvs times.</p><p>Below a bare repository is created as a central one:</p><pre class="brush: bash; title: ; notranslate">
$ git init --bare
</pre><p>Then you can clone this (remote) repository to the local one</p><pre class="brush: bash; title: ; notranslate">
$ git clone git://originrepository.place/somedir/
</pre><p>Continue to work with local repository, <em>add</em>, <em>remove</em>, and <em>commit </em>files to local one.  If you decide to propagate your changes, say at the end of a day, to the central repository, use:</p><pre class="brush: bash; title: ; notranslate">
$ git push origin master
</pre><p>Cloned repositories know their origin repository automatically. &#8220;Origins&#8221;  have to be <em>bare repository</em> because they have no checked-out working trees. If you push to a repository which has a checked-out working tree (which is still allowed) the working tree will not be updated, and that may lead to unexpected results. To sum up, let your central repositories be created by <em>git init &#8211;bare</em>.</p><p>In git it is possible to have several remote repositories for one local. You can add them like this:</p><pre class="brush: bash; title: ; notranslate">
# here http is used as example
$ git remote add  somelib http://someremoteplace/lib/repo..
</pre><p>where &#8220;somelib&#8221; is the alias of repo. Next command shows known remote locations:</p><pre class="brush: bash; title: ; notranslate">
$ git remote -v # shows defined remote repositories aliases with URLs.
</pre><p>I hope this gives you a motivation to start using GIT. Hope also to see your questions or ideas in the comments.</p><h3>More Info and Tools<img class="alignright" style="margin: 10px 15px;" title="Git logo by Dylan Beattie" src="http://www.dylanbeattie.net/git_logo/git_logo_192x106.jpg" alt="" width="192" height="106" /></h3><ul><li><a href="http://gitref.org/" target="_blank">Git command reference</a></li><li><a href="http://www.vogella.de/articles/Git/article.html#remote">Usage tutorial</a></li><li><a href="http://www.kernel.org/pub/software/scm/git/docs/user-manual.html">Git user manual</a></li><li><a href="http://progit.org/book/dontfollow" target="_blank">Git Pro Book </a>(Online)</li><li><a href="http://code.google.com/p/msysgit/">msysgit</a> git for windows</li></ul> ]]></content:encoded> <wfw:commentRss>http://alexander.holbreich.org/2011/02/git/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Java EE 5 vs Java EE 6</title><link>http://alexander.holbreich.org/2011/01/javaee5-vs-javaee6/</link> <comments>http://alexander.holbreich.org/2011/01/javaee5-vs-javaee6/#comments</comments> <pubDate>Sat, 29 Jan 2011 23:18:43 +0000</pubDate> <dc:creator>shuron</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[Software Engineering & Architecture]]></category> <category><![CDATA[Bean Validation]]></category> <category><![CDATA[CDI]]></category> <category><![CDATA[EJB]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[Java Servlet]]></category> <category><![CDATA[JAX-RS]]></category> <category><![CDATA[JAX-WS]]></category> <category><![CDATA[JAXB]]></category> <category><![CDATA[JEE5]]></category> <category><![CDATA[JEE6]]></category> <category><![CDATA[jpa]]></category> <category><![CDATA[JSR-252]]></category> <category><![CDATA[JSR-299]]></category> <category><![CDATA[JSR-315]]></category> <category><![CDATA[JSR-52]]></category> <category><![CDATA[web service]]></category><guid isPermaLink="false">http://alexander.holbreich.org/?p=812</guid> <description><![CDATA[This post visualizes changes between Java EE Standards 5 and 6. The comparison of standards is listed in four sections Web-Services, Web-Container, Enterprise Application technologies and Maintenance. Hope this helps someone. Web Service related changes Java EE 5 (JSR-244) Java EE 6 (JSR-316) JAX-RPC 1.1 JSR 101 JAX-RPC 1.1 Enterprise Web Services 1.2 JSR 109 Enterprise Web Services 1.3 [...]]]></description> <content:encoded><![CDATA[<p>This post visualizes changes between Java EE Standards 5 and 6. The comparison of standards is listed in four sections Web-Services, Web-Container, Enterprise Application technologies and Maintenance. Hope this helps someone.</p><h2>Web Service related changes</h2><table style="border: 1px solid #555555; height: 267px;" width="545"><thead><tr><th>Java EE 5 (<a href="http://www.jcp.org/en/jsr/detail?id=244">JSR-244</a>)</th><th>Java EE 6 (<a href="http://www.jcp.org/en/jsr/detail?id=316">JSR-316</a>)</th></tr></thead><tbody><tr><td>JAX-RPC 1.1 <a href="http://jcp.org/en/jsr/detail?id=101" target="_blank">JSR 101</a></td><td>JAX-RPC 1.1</td></tr><tr><td>Enterprise Web Services 1.2 <a href="http://jcp.org/en/jsr/detail?id=109" target="_blank">JSR 109</a></td><td>Enterprise Web Services <strong>1.3 </strong><em>(new version)</em></td></tr><tr><td>Web Service Metadata 1.0 <a href="http://jcp.org/en/jsr/detail?id=181" target="_blank">JSR 181</a></td><td>Web Service Metadata 1.0</td></tr><tr><td>Streaming API for XML 1.0 <a href="http://jcp.org/en/jsr/detail?id=173" target="_blank">JSR 173</a></td><td>Streaming API for XML 1.0</td></tr><tr><td>JAX-WS 2.0  <a href="http://jcp.org/en/jsr/detail?id=224" target="_blank">JSR 224</a></td><td><em>JAX-WS</em> <em><strong>2.2 </strong>(<span style="color: #ff9900;">new version</span>)</em></td></tr><tr><td>JAXB 2.0 <a href="http://jcp.org/en/jsr/detail?id=222" target="_blank">JSR 222</a></td><td><em>JAXB</em> <em><strong>2.2</strong></em> <em>(<span style="color: #ff9900;">new version</span>)</em></td></tr><tr><td>SOAP with Attachments API for Java (SAAJ) <a href="http://jcp.org/en/jsr/detail?id=67" target="_blank">JSR 67</a></td><td>Java APIs for XML Messaging 1.3 <em>(</em><span style="color: #ff9900;"><em>new version</em></span><em>) <a href="http://java.sun.com/xml/downloads/jaxm.html">spec</a><br /> </em></td></tr><tr><td></td><td><span style="color: #ff0000;"><em>new! </em></span>JAX-RS 1.1 <a href="http://jcp.org/en/jsr/detail?id=311" target="_blank">JSR 311</a></td></tr><tr><td></td><td><em><span style="color: #ff0000;">new!</span> </em>Java API for XML Registries (JAXR 1.0) <a href="http://jcp.org/en/jsr/detail?id=93" target="_blank">JSR 93</a></td></tr></tbody></table><p><span id="more-812"></span>The new redesigned Java API for XML Web Services (JAX-WS) is the base or a middle part of a newly Java EE 6 Web service stack.  The new stack  includes JAX-WS 2.0, JAXB 2.0, and SAAJ 1.3. and is also called &#8220;integrated stack&#8221;.  JAX-WS was designed to take place of JAX-RPC. Due this also JSR-109 was updated because it describes run time architecture of JEE Web Services Stack. JAXB which provides an easy way to bind an XML schema to java and vice verse, was updated to.</p><p><em>The SOAP with Attachments API</em> <em>for Java</em> (SAAJ) (also known as Java APIs for XML Messaging (JAXM)) provides a standard way to send XML documents over the Internet from the Java platform and was updated slightly containing now other consolidated standard.</p><p>New are JAX-RS, which provides support for <a href="http://www.oracle.com/technetwork/articles/javase/index-137171.html">RESTful</a> Web services and JAXR which enables pull-parsing API for reading and writing XML documents. Also available in Java SE.</p><h2>Web Applications related changes</h2><table style="border: 1px solid #555555; height: 134px;" width="545"><thead><tr><th>Java EE 5</th><th>Java EE 6</th></tr></thead><tbody><tr><td>JSTL <a href="http://jcp.org/en/jsr/detail?id=52" target="_blank">JSR 52</a></td><td>JSTL</td></tr><tr><td>JavaServer Faces 1.2 <a href="http://jcp.org/en/jsr/detail?id=252" target="_blank">JSR 252</a></td><td>JavaServer Faces <strong>2.0 </strong><em>(<span style="color: #ff9900;">new version</span>)</em></td></tr><tr><td>JavaServer Pages 2.1 <a href="http://jcp.org/en/jsr/detail?id=245" target="_blank">JSR 245</a></td><td>JavaServer Pages <strong>2.2 /EL 2.2</strong><em><strong> </strong>(<span style="color: #ff9900;">new version</span>)</em></td></tr><tr><td>Java Servlet 2.5 <a href="http://jcp.org/en/jsr/detail?id=154" target="_blank">JSR 154</a></td><td>Java Servlet 3.0 <a href="http://jcp.org/en/jsr/detail?id=315" target="_blank">JSR 315</a> <em>(<span style="color: #ff9900;">new version</span>)</em></td></tr><tr><td></td><td><em><span style="color: #ff0000;">new!</span> </em>Debugging Support for Other Languages 1.0 <a href="http://jcp.org/en/jsr/detail?id=45" target="_blank">JSR 45</a> <em></em></td></tr></tbody></table><p>In Java EE 6 we have updates of all technologies of the Web Container except JSTL. So e.g. Servlet 3.0 improves Servlet concept in pluggability and some ease of development. It&#8217;s also introduces Async Servlet, and long waited File Uploading!. Also now configuration can be done by annotations.</p><p>New a specification of <em>Debugging Support for Other Languages</em> 1.0<br /> This describes standardized tools for correlating Java virtual machine byte code to source code of languages other than the Java programming language, so it would guarantee debugging possibility of everything what runs is JSR-45 certified container.</p><h2>Enterprise Technologies changes</h2><table style="border: 1px solid #555555; height: 342px;" width="545"><thead><tr><th>Java EE 5</th><th>Java EE 6</th></tr></thead><tbody><tr><td>Common Annotations <a href="http://jcp.org/en/jsr/detail?id=250" target="_blank">JSR 250</a></td><td>Common Annotations<strong> </strong><em></em></td></tr><tr><td>JCA 1.5 <a href="http://jcp.org/en/jsr/detail?id=112" target="_blank">JSR 112</a></td><td>JCA 1.6 <a href="http://jcp.org/en/jsr/detail?id=322" target="_blank">JSR 322</a> <em>(</em><span style="color: #ff9900;"><em>new version</em></span><em>)</em></td></tr><tr><td>JavaMail 1.4</td><td>JavaMail 1.4<em></em></td></tr><tr><td>JMS 1.1 <a href="http://jcp.org/en/jsr/detail?id=914" target="_blank">JSR 914</a></td><td>JMS 1.1</td></tr><tr><td>JTA 1.1 <a href="http://jcp.org/en/jsr/detail?id=907">JSR 907</a></td><td>JTA 1.1</td></tr><tr><td>Enterprise JavaBeans 3.0 <a href="http://jcp.org/en/jsr/detail?id=220">JSR 220</a></td><td>Enterprise JavaBeans <strong>3.1</strong> <a href="http://jcp.org/en/jsr/detail?id=318">JSR 318</a><br /> <em>(<span style="color: #ff9900;">new version</span>)</em></td></tr><tr><td>JPA 1.0 <a href="http://jcp.org/en/jsr/detail?id=220">JSR 220 </a>(together with EJB 3.0)</td><td>JPA 2.0 <a href="http://jcp.org/en/jsr/detail?id=317" target="_blank">JSR 317</a> (<span style="color: #ff9900;"><em>new version</em></span>)</td></tr><tr><td></td><td><em><span style="color: #ff0000;">new!</span> </em>Contexts and Dependency Injection for Java (Web Beans 1.0) <a href="http://jcp.org/en/jsr/detail?id=299" target="_blank">JSR 299</a></td></tr><tr><td></td><td><em><span style="color: #ff0000;">new!</span></em> Dependency Injection for Java 1.0 <a href="http://jcp.org/en/jsr/summary?id=330" target="_blank">JSR 330</a></td></tr><tr><td></td><td><em><span style="color: #ff0000;">new!</span></em> Bean Validation 1.0 <a href="http://jcp.org/en/jsr/detail?id=303" target="_blank">JSR 303</a></td></tr><tr><td></td><td><em><span style="color: #ff0000;">new!</span></em> Managed Beans 1.0 <a href="http://www.jcp.org/en/jsr/detail?id=316">JSR-316</a></td></tr></tbody></table><p>In Enterprise Application section we see some important changes and new specifications. Most famous and important is  JSR-299 Context and Dependency Injection (CDI) which is there to unify the JavaServer Faces-managed bean component model with the Enterprise JavaBeans component model to simplify the programming model and architecture of web-based applications. Look an <a href="http://www.seamframework.org/Weld" target="_blank">Weld Framework</a> as reference implementation to this.</p><p>The similar sounding Standard <em>Dependency Injection for Java</em> JSR-330 just define a standard and common known DI like in spring and other frameworks. Look at popular Guice DI-Framework from Google which <a href="http://code.google.com/p/google-guice/wiki/JSR330" target="_blank">implements JSR-330</a>.</p><p>Bean Validation  introduces a very cool annotation based and architecture layer independent Java Bean validation.</p><p>There are also some interesting improvements in EJBs. Singleton is a new type and can be only one per container, it is also possible to use @Local Beans (Same VM) without interface. Also JPA 2.0 has advanced query possibilities and validation.</p><h2>Management Technologies</h2><table style="border: 1px solid #555555; height: 247px;" width="545"><thead><tr><th>Java EE 5</th><th>Java EE 6</th></tr></thead><tbody><tr><td>J2EE Application Deployment 1.2 <a href="http://jcp.org/en/jsr/detail?id=88" target="_blank">JSR 88</a></td><td>J2EE Application Deployment 1.2<strong><br /> </strong></td></tr><tr><td>JavaBeans Activation Framework (JAF) 1.1 <a href="http://jcp.org/en/jsr/detail?id=925" target="_blank">JSR 925</a></td><td>JavaBeans Activation Framework (JAF) 1.1</td></tr><tr><td>J2EE Management 1.0  <a href="http://jcp.org/en/jsr/detail?id=077" target="_blank">JSR 77</a></td><td>J2EE Management 1.1<em> (<span style="color: #ff9900;">new version</span>)</em></td></tr><tr><td>Java Authorization Contract for Containers 1.1 <a href="http://jcp.org/en/jsr/detail?id=115" target="_blank">JSR 115</a></td><td>Java Authorization Contract for Containers 1.3<em>(</em><span style="color: #ff9900;"><em>new version</em></span><em>)</em></td></tr><tr><td></td><td><em><span style="color: #ff0000;">new!</span></em> Java Authentication Service Provider Interface for Containers <a href="http://jcp.org/en/jsr/detail?id=196" target="_blank">JSR 196</a></td></tr><tr><td></td><td><em><span style="color: #ff0000;">new!</span></em> [<span style="color: #666699;">JavaSE</span>] JAXP 1.3 <a href="http://jcp.org/en/jsr/detail?id=206" target="_blank">JSR 206</a></td></tr><tr><td></td><td><span style="color: #ff0000;"><em>new!</em> </span>[<span style="color: #666699;">JavaSE</span>] JDBC 4.0 <a href="http://jcp.org/en/jsr/detail?id=221" target="_blank">JSR 221</a></td></tr><tr><td></td><td><span style="color: #ff0000;"><em>new!</em> </span>[<span style="color: #666699;">JavaSE</span>] JMX 2.0 <a href="http://jcp.org/en/jsr/detail?id=255" target="_blank">JSR 255</a></td></tr></tbody></table><p>Nothing special to mention here.</p><h2>Java EE 6 Certified Application Server</h2><ul id="ibm-navigation-trail"><li>Oracle (former Sun) <a href="http://glassfish.java.net/downloads/3.0.1-final.html" rel="nofollow" target="_blank">GlassFish AS 3.0.1 </a>Full certified</li><li><a href="http://www.jboss.org/jbossas/downloads.html" rel="nofollow" target="_blank">JBoss AS 6.0.0</a> Web Profile certification</li><li>IBM <a href="https://www14.software.ibm.com/iwm/web/cc/earlyprograms/websphere/wsasoa/index.shtml" rel="nofollow" target="_blank">WebSphere Application Server V8.0</a> (in development, Beta available) should be full certified</li></ul><p>Please feel free to correct me or provide additional information.</p> ]]></content:encoded> <wfw:commentRss>http://alexander.holbreich.org/2011/01/javaee5-vs-javaee6/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>Java WebServices JSR overview</title><link>http://alexander.holbreich.org/2010/10/java-webservices-jsrs-overview/</link> <comments>http://alexander.holbreich.org/2010/10/java-webservices-jsrs-overview/#comments</comments> <pubDate>Wed, 20 Oct 2010 22:51:12 +0000</pubDate> <dc:creator>shuron</dc:creator> <category><![CDATA[JBoss]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Software Engineering & Architecture]]></category> <category><![CDATA[community]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[JAX-RS]]></category> <category><![CDATA[JAX-WS]]></category> <category><![CDATA[jcp]]></category> <category><![CDATA[jee]]></category> <category><![CDATA[JSR]]></category> <category><![CDATA[JSR-224]]></category> <category><![CDATA[JSR-311]]></category><guid isPermaLink="false">http://alexander.holbreich.org/?p=596</guid> <description><![CDATA[Here give a short overview of important JSR of Java Community Process which define and standardises  WebServices development on Java Platform. JSR-175: A Metadata Facility for the JavaTMTM Programming Language. Also known as Java Annotations e.g. @Deprecated or @Override. JSR-181: Web ServiceMetadatata for the Java Platform. This is just a set of Annotations for using [...]]]></description> <content:encoded><![CDATA[<p><a href="http://alexander.holbreich.org/wp-content/uploads/2010/10/jcp.gif?4c9b33"><img class="size-full wp-image-600 alignright" style="margin: 10px;" title="jcp" src="http://alexander.holbreich.org/wp-content/uploads/2010/10/jcp.gif?4c9b33" alt="Java community process" width="112" height="59" /></a>Here give a short overview of important JSR of Java Community Process which define and standardises  WebServices development on Java Platform.</p><ul><li><a href="http://jcp.org/en/jsr/detail?id=175" target="_blank">JSR-175</a>: <em>A Metadata Facility for the JavaTM<sup>TM</sup> Programming Language</em>. Also known as Java Annotations e.g. @Deprecated or @Override.</li><li><a href="http://jcp.org/en/jsr/detail?id=181" target="_blank">JSR-181</a>: <em>Web ServiceMetadatata for the Java Platform. </em>This is just a set of Annotations for using with JAX-WS WebServiceses. Think of  Annotations @WebService, @WebMethod&#8230;</li><li><a href="http://jcp.org/en/jsr/detail?id=101">JSR-101</a>: <em>API for XML-based RPC: JAX-RPC 1.1. </em>Definiton of RCP call with SOAP Messages, Type Mapping between Java  and XML.<em><br /> </em></li><li><a href="http://jcp.org/en/jsr/detail?id=109" target="_blank">JSR-109:</a><em> Implementing Enterprise Web Services Definiton</em> of WebsServices based on JAX-RPC which is now accessed by JAX-WS. That early standard defined WebServiceses for J2EE 1.4. It enabled implementation of Web-Serviceses as Endpoints over Enterprise Session Bean&#8217;s (EJB 2 generation with awful  XML descriptors).</li><li><a href="http://jcp.org/en/jsr/detail?id=183" target="_blank">JSR 183</a>: <em>Web Services Message Security APIs<br /> </em></li><li><a href="http://jcp.org/en/jsr/detail?id=224" target="_blank">JSR-224:</a> <strong><em>The Java API for XML-Based Web Services (JAX-WS) 2.2</em></strong><ul><li>Final Release 05.2006 (Version 2.0 JEE 5) ,Last Maintenance 12.200Verisonon (2.2 JEE 6).</li><li>Current state of the art</li><li>Relies on its own Architecture for XML Binding <a href="http://jcp.org/en/jsr/detail?id=222" target="_blank">JSR -222</a></li><li>Of course supports Annotations JSR -181</li><li>Implementations: <a href="http://cxf.apache.org/">Apache CXF</a>, <a href="http://www.jboss.org/jbossws" target="_blank">JBoss WS</a>, <a href="https://jax-ws.dev.java.net/" target="_blank">JAX-WS</a> as Sun&#8217;s Ref. Implementation</li></ul></li><li><a href="http://jcp.org/en/jsr/detail?id=311" target="_blank">JSR-311</a>: <strong><em>JAX-RS: Java <sup>TM</sup> API RESTful Web Services</em></strong><ul><li>Final Release 10.2008</li><li>Part of JEE 6</li><li>AlWeb Servicesvices of REST Style jusPOJOsPOJOs</li><li>Mseen ssen such typical Annotations like: @Path , @GET，@PUT, @POST，@DELETE</li><li>Implementations: <a href="http://cxf.apache.org/">Apache CXF</a>, <a href="http://incubator.apache.org/wink/" target="_blank">Apache Wink</a>, <a href="http://www.jboss.org/resteasy" target="_blank">Resteasy</a> as part of JBoss/Tomcat,   <a href="https://jersey.dev.java.net/">Jersey</a> &#8211; Sun&#8217;s Ref. implementation.</li></ul></li></ul><p>Did I forgot something?</p> ]]></content:encoded> <wfw:commentRss>http://alexander.holbreich.org/2010/10/java-webservices-jsrs-overview/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Get JIRA for 10$ only</title><link>http://alexander.holbreich.org/2010/05/use-jira/</link> <comments>http://alexander.holbreich.org/2010/05/use-jira/#comments</comments> <pubDate>Tue, 25 May 2010 21:44:45 +0000</pubDate> <dc:creator>shuron</dc:creator> <category><![CDATA[CMS]]></category> <category><![CDATA[Internet]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[Personal]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Software Engineering & Architecture]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[best time]]></category> <category><![CDATA[developer tools]]></category> <category><![CDATA[jira]]></category> <category><![CDATA[project tracking system]]></category> <category><![CDATA[simplicity]]></category><guid isPermaLink="false">http://alexander.holbreich.org/?p=588</guid> <description><![CDATA[Probably most of modern IT related people know Atlassian JIRA &#8211; issue and project tracking system. Maybe many of you know other popular tracking system like Bugzilla, GNATS, und many many others. Personally I like JIRA last but not least because i worked many years with it and I&#8217;m impressed of a simplicity of the [...]]]></description> <content:encoded><![CDATA[<p>Probably most of modern IT related people know Atlassian JIRA &#8211; issue and project tracking system. Maybe many of you know other popular tracking system like Bugzilla, GNATS, und <a href="http://en.wikipedia.org/wiki/Comparison_of_issue_tracking_systems" target="_blank">many many others</a>. Personally I like JIRA last but not least because i worked many years with it and I&#8217;m impressed of a simplicity of the work flow and the realisation of the concepts around it.</p><p>However this is not one post which should bring JIRA near to you. But if you know that you need it, now is best time to get it, because Atlassian started their &#8220;<a href="http://www.atlassian.com/software/jira/pricing.jsp" target="_blank">Get Startet</a>&#8221; Price, which now allows you to by full functional <span style="text-decoration: underline;">JIRA for 10$ for ever</span> even with one year support. All you need is a little bit of free CPU time, root access, 10$ and if you buy it outside of USA, you will need a credit card.</p><p>I installed it  for my private purposes and it works fine! I just followed Atlassian documentation (Read it carefully). Maybe, the easiest way is to install the &#8220;all in one&#8221; solution which comes with Apache Tomcat. I choosed that one. But don&#8217;t forget to switch to serious database before you start really using it. Take MySQL for example like I did.</p><p>I will not provide here step by step how to do it, because <a href="http://simon.zambrovski.org/2010/05/jira-home-improvement/" target="_blank">Simon has already</a> described some of the important configurations moments as he heard about new pricing <img src="http://alexander.holbreich.org/wp-includes/images/smilies/icon_smile.gif?4c9b33" alt=':)' class='wp-smiley' /> and as already mentioned the Atlassian installation guide is good and really answered all my questions.</p><p>Nevertheless feel free to ask questions here, about installation and configuration to.</p><p>Also i would like to discuss other Atlassian developer tools which also available for 10$. Is here outside someone experienced in bamboo?</p> ]]></content:encoded> <wfw:commentRss>http://alexander.holbreich.org/2010/05/use-jira/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Eclipse Ganymede and WSCompile incompatibility?</title><link>http://alexander.holbreich.org/2009/02/eclipse-ganymede-and-wscompile-incompatibility/</link> <comments>http://alexander.holbreich.org/2009/02/eclipse-ganymede-and-wscompile-incompatibility/#comments</comments> <pubDate>Wed, 25 Feb 2009 17:34:34 +0000</pubDate> <dc:creator>shuron</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Software Engineering & Architecture]]></category> <category><![CDATA[eclipse]]></category> <category><![CDATA[Europa]]></category> <category><![CDATA[Ganymede]]></category> <category><![CDATA[Wscompile]]></category><guid isPermaLink="false">http://alexander.holbreich.org/?p=400</guid> <description><![CDATA[I found strange problem with WSCompile-1.6 task in Ganymede release of Eclipse (Version 3.4.1). The problem lies in WSCompile-Ant-Task. Build-script execution freezes on the wscompile task. I describe that problem more detailed on techjava.de Please feel free to comment here or there if you know what died changed in Ganymede in ant scripts handling since [...]]]></description> <content:encoded><![CDATA[<p>I found strange problem with WSCompile-1.6 task in Ganymede release of Eclipse (Version 3.4.1). The problem lies in WSCompile-Ant-Task. Build-script execution freezes on the wscompile task. I describe that problem more detailed on <a href="http://www.techjava.de/topics/2009/02/ganymede-wscompile/">techjava.de</a></p><p>Please feel free to comment here or there if you know what died changed in Ganymede in ant scripts handling since Europe release and how to fix it.</p><h3>UPD. Solution!</h3><p>The problem seems not to do anything with eclipse (logical) but it depends on used ant version. Some version are not good for wscompile.<br /> In my case ant version 1.6.5 and 1.7.1 where not good for wscompile task.<br /> In ant 1.7.0 wscompile tasks works as usual.<br /> May this help somebody! <img src="http://alexander.holbreich.org/wp-includes/images/smilies/icon_wink.gif?4c9b33" alt=';)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://alexander.holbreich.org/2009/02/eclipse-ganymede-and-wscompile-incompatibility/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Curiosity: How IDE features affects design quality</title><link>http://alexander.holbreich.org/2007/08/curiosity-how-ide-features-affects-design-quality/</link> <comments>http://alexander.holbreich.org/2007/08/curiosity-how-ide-features-affects-design-quality/#comments</comments> <pubDate>Mon, 27 Aug 2007 15:59:45 +0000</pubDate> <dc:creator>shuron</dc:creator> <category><![CDATA[Humour]]></category> <category><![CDATA[Software Engineering & Architecture]]></category> <category><![CDATA[ide]]></category><guid isPermaLink="false">http://alexander.holbreich.org2007/08/curiosity-how-ide-features-affects-design-quality/</guid> <description><![CDATA[Don&#8217;t believe that? Than listen to the story&#8230; Occupational i deal with people who works with already aged version WSAD (Rational Application Developer for Web Sphere). I think they use version 5 which is based on eclipse platform in version 2.0 or 2.1 where folding was not supported. Folding feature of eclipse based IDE&#8217;s allows [...]]]></description> <content:encoded><![CDATA[<p>Don&#8217;t believe that? Than listen to the story&#8230;</p><p>Occupational i deal with people who works with already aged version WSAD (Rational Application Developer for Web Sphere). I think they use version 5 which is based on eclipse platform in version 2.0 or 2.1 where folding was not supported.</p><p>Folding feature of eclipse based IDE&#8217;s allows you to clap uninteresting code fragments like methods constructors or imports out from your scope just in place. <a title="Eclipse Codefolding" href="http://alexander.holbreich.org/wp-content/uploads/2007/08/codefolding.jpg?4c9b33"></a></p><p style="text-align: center"><a title="Eclipse Codefolding" href="http://alexander.holbreich.org/wp-content/uploads/2007/08/codefolding.jpg?4c9b33"><img src="http://alexander.holbreich.org/wp-content/uploads/2007/08/codefolding.jpg?4c9b33" alt="Eclipse Codefolding" /></a></p><p>So one of developers was just dropping all of his classes in just one package, doing it in apposite to the structure of whole project. He argued that doing so, hi has only one import statement in his classes for all classes from his &#8220;containing all&#8221; package. Having 15-20 import statements in a class disturbs!</p><p>God bless folding feature! Curtain!</p> ]]></content:encoded> <wfw:commentRss>http://alexander.holbreich.org/2007/08/curiosity-how-ide-features-affects-design-quality/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Don&#8217;t let trigger take control</title><link>http://alexander.holbreich.org/2007/08/dont-let-triggers-take-control/</link> <comments>http://alexander.holbreich.org/2007/08/dont-let-triggers-take-control/#comments</comments> <pubDate>Sat, 11 Aug 2007 23:28:50 +0000</pubDate> <dc:creator>shuron</dc:creator> <category><![CDATA[Software Engineering & Architecture]]></category> <category><![CDATA[database]]></category> <category><![CDATA[trigger]]></category><guid isPermaLink="false">http://alexander.holbreich.org2007/08/dont-let-triggers-take-control/</guid> <description><![CDATA[In earlier times of Database Systems, as triggers were proposed (e.g. by Eswaran1, Eswaran2 ), the goal of such DB mechanisms like trigger, was clear. Triggers appears for extending of Integrity control in Database Systems and became following definition: &#8230; Database Trigger is predefined database procedure, conditionally or unconditionally succeeding or preceding other database operations [...]]]></description> <content:encoded><![CDATA[<p>In earlier times of Database Systems, as triggers were proposed (e.g. by <a title="Functional Specifications of Subsystem for Database Integrity." href="http://www.informatik.uni-trier.de/~ley/db/conf/vldb/EswaranC75.html">Eswaran1</a>, <a title="Aspects of a trigger subsystem in an integrated database system" href="http://portal.acm.org/citation.cfm?id=807683" target="_blank">Eswaran2</a> ), the goal of such DB mechanisms like trigger, was clear. Triggers appears for extending of <span style="font-weight: bold">Integrity control</span> in Database Systems and became following definition:</p><p style="font-style: italic">&#8230; Database Trigger is predefined database procedure, conditionally or unconditionally succeeding or preceding other database operations automatically&#8230;[IBM Research Report, RJ1820, 1976]</p><p>That is actually what triggers are still today. But alone that definition make clear, that triggers can be also exploited for other purposes, like audit or security, but also for modelling (parts) of application logic or business rules. The main question, that appears is what should triggers do, what it can be used for, and when it becomes ugly? Generalising question thereby is, how much business logic should be done by the Database systems.</p><p>You can quick &#8220;google&#8221; for some answers like <a title="Database Business Logic" href="http://evanhoff.com/archive/2007/06/05/19.aspx">evans</a> or  from <a title="Dude, where's my business logic?" href="http://www.codeproject.com/gen/design/DudeWheresMyBusinessLogic.asp">codeproject</a>. But also academia gives similar answers. And this is good so,<span style="font-weight: bold"> then there is no need to put application logic to Database tier</span>, contrariwise logic in the database tier is contra productive.</p><p>At the moment i have to deal with some very large logistic system which logic is mostly implemented as triggers, not even stored procedures but triggers. The decision to build that system on triggers is unforgivable, even if that System was concept for years (i don&#8217;t know how old is it). I thing everybody understand why dealing with triggers is not comparable with one clean implementation of logic through e.g. 2EE based Middle-tier. At first the main logic and rules of the system are spread in a hundreds of triggers over hundreds of tables and therefore it is very difficult to maintenance. Secondly there are many side effects present, and many of them are unfortunately hard to predict, so that some kind of not determinism is always in the air. And at third there are problems on bulk updates, of course, when triggers start the avalanche, cascading each other!</p><p>Well, the richness of DB functions and options alone, should not lead to the meaning that all logic should be done in  the Database-tier. Of course Database  Systems which are rich on functions sells better. Yea! Maybe even better than sex <img src="http://alexander.holbreich.org/wp-includes/images/smilies/icon_smile.gif?4c9b33" alt=':)' class='wp-smiley' /> .  But at the End we should be carefully with every extra!</p><p>Concluding there are some tips when to use triggers:</p><p>1. Use them for Integrity control! There where invented for it!</p><p>2. Use them careful for Audit trails, consider also triggers are transaction safe, so when an operation is rolled back, all its triggered operations are also rolled back.</p><p>3. Use trigger careful for other administrative things like replication or notification.</p><p>4. <strong>Avoid to use triggers for business logic</strong>!</p><p>P.S. Next time i maybe explain why it is bad idea to programm Business applications in Visual Basic or atomate business processes witch MS Access <img src="http://alexander.holbreich.org/wp-includes/images/smilies/icon_smile.gif?4c9b33" alt=':)' class='wp-smiley' /> )))</p> ]]></content:encoded> <wfw:commentRss>http://alexander.holbreich.org/2007/08/dont-let-triggers-take-control/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to test J2EE Applications</title><link>http://alexander.holbreich.org/2007/01/how-to-test-j2ee-applications/</link> <comments>http://alexander.holbreich.org/2007/01/how-to-test-j2ee-applications/#comments</comments> <pubDate>Thu, 25 Jan 2007 19:33:36 +0000</pubDate> <dc:creator>shuron</dc:creator> <category><![CDATA[Software Engineering & Architecture]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[jee]]></category> <category><![CDATA[testing]]></category><guid isPermaLink="false">http://alexander.holbreich.org2007/01/how-to-test-j2ee-applications/</guid> <description><![CDATA[Most java developers use (ok, ok maby just know about ) Junit. JUnit provides an effective and easy way to unit test client-side Java applications. Here is an very short example, just to see how easy you can build client-side Junit tests: {[.junit1 /enzymes/s_java.php]} JunitEE But Junit has some limitations, therefore, testing in each application [...]]]></description> <content:encoded><![CDATA[<p>Most java developers use (ok, ok maby just know about <img src="http://alexander.holbreich.org/wp-includes/images/smilies/icon_smile.gif?4c9b33" alt=':)' class='wp-smiley' /> ) <a href="http://junit.org/" target="_blank" title="Junit">Junit</a>. JUnit provides an effective and easy way to unit test client-side Java applications. Here is an very short example, just to see how easy you can build client-side Junit tests:<br /> {[.junit1 /enzymes/s_java.php]}</p><h2>JunitEE</h2><p>But Junit has some limitations, therefore, testing in each application server container becomes a tedious process. The <strong>JunitEE test framework</strong> addresses these limitations. This framework extends the standard JUnit so that tests can be executed in an application server container. JunitEE is configured in the J2EE Web module of a unit test application, and it uses a TestRunner to output HTML or XML test results. So according to <a href="http://junitee.org/" title="JunitEE">Junitee.org</a> there are following benefites :</p><ul><li>Your tests are packaged conveniently into a .war file which 				can easily be moved between servers; you can leave the 				.war file in the main .ear file and simply avoid enabling 				the test web application on the production server.</li><li>Your test classes will be dynamically reloaded by the app 				server (assuming your server supports this).</li><li>Your test cases look just like your production code, 				and can use the same beans (or whatever) you use as 				a facade for your EJBs.</li></ul><p>How it works? Roughly it could be described like below, see resources for detailed examples:</p><ol><li>Develop JUnit test cases</li><li>Create and configure a JUnitEE test modulePlace<ol><li><code>junit.jar </code> and <code>junitee.jar</code> files in the project classpath by placing them in the <code>WEB-INF/lib</code> directory</li><li>a jar file, like <code>MyUnitTest.jar</code>, containing your Test classes. Copy this file<code> into the <code>WEB-INF/lib </code> directory too</code></li><li>Include in the Servlet description like shown below in the <code>web.xml</code> deployment descriptor</li></ol></li><li>Deploy and execute test cases on the Application Server.</li></ol><p>{[.xml1 /enzymes/xml.php]}</p><h2>Resources</h2><ol><li><a href="http://www.junitee.org/tutorial.html" target="_blank">New features in Junit 4</a></li><li><a href="http://www.junitee.org/tutorial.html" target="_blank">JunitEE Tutorial</a></li><li><a href="http://www.junit.org/news/extension/j2ee/index.htm" target="_blank" title="JunitEE"> Other Junit Extensions for J2EE</a></li><li><a href="http://www-128.ibm.com/developerworks/rational/library/07/0102_woldemichael/index.html?ca=drs-" target="_blank">An extended example from IBM</a></li></ol><ul><li></li></ul> ]]></content:encoded> <wfw:commentRss>http://alexander.holbreich.org/2007/01/how-to-test-j2ee-applications/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>First Look at Java Persistence API (JPA)</title><link>http://alexander.holbreich.org/2007/01/first-look-at-java-persistence-api/</link> <comments>http://alexander.holbreich.org/2007/01/first-look-at-java-persistence-api/#comments</comments> <pubDate>Sat, 13 Jan 2007 20:32:28 +0000</pubDate> <dc:creator>shuron</dc:creator> <category><![CDATA[java]]></category> <category><![CDATA[Software Engineering & Architecture]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[jpa]]></category> <category><![CDATA[jsr-220]]></category> <category><![CDATA[persistence]]></category><guid isPermaLink="false">http://alexander.holbreich.org/blog/2007/01/first-look-at-java-persistence-api/</guid> <description><![CDATA[The Java Persistence API page on java.sun.com describes the Persistence API as: The Java Persistence API provides a POJO persistence model for object-relational mapping. The Java Persistence API was developed by the EJB 3.0 software expert group as part of JSR 220, but its use is not limited to EJB software components. It can also [...]]]></description> <content:encoded><![CDATA[<p>The <a title="Java Persistence API on java.sun.com" href="http://java.sun.com/javaee/technologies/entapps/persistence.jsp" target="_blank">Java Persistence API page on java.sun.com</a> describes the Persistence API as:</p><blockquote><p><em>The Java Persistence API provides a POJO persistence model for object-relational mapping. The Java Persistence API was developed by the <a title="EJB" href="http://java.sun.com/products/ejb/" target="_blank">EJB 3.0</a> software expert group as part of <a title="JSR 220" href="http://jcp.org/en/jsr/detail?id=220" target="_blank">JSR 220</a>, but its use is not limited to EJB software components. It can also be used directly by web applications and application clients, and even outside the Java EE platform, for example, in Java SE applications</em></p></blockquote><p class="pBody">So let&#8217;s look a bit deeper into the features of new API.</p><p class="pBody">Persistence is dealing with entities. An Entitiy is a lightweight domain specific object (in java) that sometimes should be stored to persistent storage of some kind (e.g. Relational Database).  Typically an entity is represented by a Databae table in a relational databases and each entity instance corresponds with a row in that table.</p><p class="pBody">In the Java Persistence API,  persistent state of an entity is represented either through persistent fields or persistent properties. These fields  use object-relational mapping annotations to map the entities and entity relationships to the relational data in the underlying data store.</p><p class="pBody">So Entities are marked with the <code>@Entity (javax.persistence.Entity)</code> annotation and the entity-class should implement <em>Serializable</em> interface. Further<a title="JEE Tutorial" href="http://java.sun.com/javaee/5/docs/tutorial/doc/?wp406143&amp;PersistenceIntro.html#wp78460" target="_blank"> requirements for entitiy classes</a> can be found in the Java EE 5 Tutorial.</p><p class="pBody">Here is  just little examle of Persisten entitiy &#8220;User&#8221;.</p><p class="pBody"><pre class="brush: java; title: ; notranslate">package de.holbreich.chopping;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Id;

@Entity
@Table (name=&quot;User&quot;)
public class Userimplements Serializable {
 @Id
 @Column(name=&quot;id&quot;, nullable=false)
 private String userId;

 @Column(name=&quot;Username&quot;)
 private String username;

 @Column(name=&quot;Firstname&quot;)
 private String firstname

 public void setUserId(String userId){
 this.userId= userId;
 }

 public String getUserId() {
 return this.userId;
 }

 public void setUsername(String username) {
 this.username=username;
 }

 public String getUsername() {
 return this.username;
 }
...
}</pre><p>If the entity name is the same as that of the table name, <code>@Table</code> is not required. The same with <code>@Column Attribute.</code> Not Persistent Fields or methods should be marked with <code class="cCode">@Transient.</code> Here more Information about <a href="http://java.sun.com/javaee/5/docs/tutorial/doc/?wp406143&amp;PersistenceIntro.html#wp78460" target="_blank">persistent field and properties</a> and especially <a title="Primery Keys in Entities" href="http://java.sun.com/javaee/5/docs/tutorial/doc/?wp406143&amp;PersistenceIntro.html#wp78460" target="_blank">Primary Keys</a>.<br /> So far its quite simple.</p><p>Entities can have relations to each other. Java Persistence API knows four types of multiplicities: <em>one-to-one, one-to-many, many-to-one, and many-to-many</em>, which are marked with appropriate anotations. Furthermore relationships can be <em>unidirectional</em> or <em>bidirectional</em>.  In a <span style="font-style: italic;">unidirectional</span> relationship, only one entity has a relationship field or property that refers to the other. <a title="Relations" href="http://java.sun.com/javaee/5/docs/tutorial/doc/?wp406143&amp;PersistenceIntro.html#wp78460" target="_blank">Read more about it</a>.</p><p>This looks really interesting to me. But it gone to be better then, the Java Persistence API has an important new feature that was not covered bu SUN before: <strong>support for inheritance and polymorphism</strong>. An entity may inherit from another entity class. By default, the queries are polymorphic and are applicable against the entire entity hierarchy. Read more about <a title="Java Persistence API (Inheritance)" href="http://www.javaworld.com/javaworld/jw-01-2007/jw-01-aop.html">inheritance posibilities</a>.</p><p>An finely there is a new and better Query language</p><h3>Queries and query language</h3><p>The Java Persistence query language (JPQL) is an extension of the EJB QL, but overcomes EJB QL&#8217;s limitations and provides more features such as:</p><ul><li>Bulk update and delete operations</li><li>Join operations</li><li>Group-by operations</li><li>Having operations</li><li>Projection and sub-queries</li><li>Support for dynamic queries</li><li>Use of named parameters (named parameters are parameters in a query that are prefixed with a colon (<code>:</code>))</li></ul><p><a href="http://java.sun.com/javaee/5/docs/tutorial/doc/?wp406143&amp;PersistenceIntro.html#wp78460" target="_blank">More on JPQL in the Tutorial</a></p><h3>Management of entities</h3><p>Entities are managed by the <em>entity manager</em>. The entity manager is represented by <code class="cCode">javax.persistence.EntityManager</code> instances. Each <code class="cCode">EntityManager</code> instance is associated with a persistence context. A persistence context is a set of managed entity instances that exist in a particular data store and defines the scope under which particular entity instances are created, persisted, and removed.</p><p>As expected the are two kinds of managers an container managed and one application managed.<br /> With a <em class="cEmphasis">container-managed entity manager</em>, an <code class="cCode">EntityManager</code> instance&#8217;s persistence context is automatically propagated by the container to all application components that use the <code class="cCode">EntityManager</code> instance within a single Java Transaction Architecture (JTA) transaction.</p><pre class="brush: java; title: ; notranslate">

@PersistenceContext(unitName=&quot;user&quot;)
EntityManager em;
</pre><p>With <em class="cEmphasis">application-managed entity managers</em>, on the other hand, the persistence context is not propagated to application components, and the life-cycle of <code class="cCode">EntityManager</code> instances is managed by the application.</p><pre class="brush: java; title: ; notranslate">

@PersistenceUnit(unitName=&quot;user&quot;)
EntityManagerFactory emf;
EntityManager em = emf.createEntityManager();
</pre><p>Persistent context is described in <em>persistense.xml</em> file</p><h3>Conclusion</h3><p>I thik the Java Persistence API is an real cool standard, hope start use it soon. Here are the key features of it summarized:</p><ul><li>Standardizes the persistence API for the Java platform</li><li>Brings simplification through a simple POJO-based persistence model</li><li>Annotations should makes entity coding and deployment easier</li><li>And of course features like support for inheritance and polymorphism, simplistic entity relationship declaration bring the whole thing to new level.</li><li>Advantages of JPQL</li></ul><p>Furthermore Java Persistence API can be used for Java SE environments too. This is possible because of the Java Persistence API&#8217;s support outside the EJB container.</p><ol><li><a title="Java Persistence API (on java.sun.com)" href="http://java.sun.com/javaee/technologies/entapps/persistence.jsp" target="_blank">Java Persistence API on java.sun.com</a></li><li><a title="Java JEE Tutorial Persistence" href="http://java.sun.com/javaee/5/docs/tutorial/doc/?wp406143&amp;PersistenceIntro.html#wp78460">Java Persistence API in the Java EE 5 Tototial</a></li><li><a title="JavaWorl Articel abot J" href="http://www.javaworld.com/javaworld/jw-01-2007/jw-01-aop.html" target="_blank">Good Article goes detailed on inheritance at JavaWorld</a></li><li><a href="http://java.sun.com/javaee/5/docs/tutorial/doc/?wp406143&amp;PersistenceIntro.html#wp78460">Extended fetures in Examples of using Persistence API in EJB tier<br /> </a></li><li><a href="http://alexander.holbreich.org/blog/Using%20Java%20Persistence%20With%20JavaServer%20Faces%20Technology,%20and%20Using%20a%20Model%20Facade">Using Persistens with JSF</a></li><li><a href="http://java.sun.com/mailers/techtips/corejava/2006/tt1118.html?feed=JSC#1" target="_blank">Java WebStart Persistence</a></li></ol> ]]></content:encoded> <wfw:commentRss>http://alexander.holbreich.org/2007/01/first-look-at-java-persistence-api/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/47 queries in 0.039 seconds using disk: basic
Object Caching 1094/1218 objects using disk: basic

Served from: alexander.holbreich.org @ 2012-02-04 20:35:36 -->
