<?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>Sami Dalouche &#187; Java</title>
	<atom:link href="http://www.dalouche.com/wordpress/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dalouche.com/wordpress</link>
	<description>Sami Dalouche's blog about Linux, Java, .NET and other bleeding-edge stuff. skoobi@free.fr</description>
	<lastBuildDate>Fri, 20 Jan 2012 12:30:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Java, from different viewpoints</title>
		<link>http://www.dalouche.com/wordpress/2006/12/16/java-from-different-viewpoints/</link>
		<comments>http://www.dalouche.com/wordpress/2006/12/16/java-from-different-viewpoints/#comments</comments>
		<pubDate>Sat, 16 Dec 2006 09:56:59 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2006/12/16/java-from-different-viewpoints/</guid>
		<description><![CDATA[Here is a funny, satirical comment from Daniel Spiewak on Java code produced by different people (student, professor, developer&#8230;).
We can probably draw a parallel with the funny quotes about Java  I previously cited.
My opinion is that every Java developer is aware that everything he does is far more complex than it should be. However, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jroller.com/page/djspiewak?entry=java_skill_levels">Here is a funny, satirical comment</a> from Daniel Spiewak on Java code produced by different people (student, professor, developer&#8230;).</p>
<p>We can probably draw a parallel with the funny quotes about Java  <a href="http://www.dalouche.com/wordpress/2006/11/04/funny-quote-java-vs-php/">I previously cited</a>.</p>
<p>My opinion is that every Java developer is aware that everything he does is far more complex than it should be. However,  abstraction is the key foundation of Computer Science, and most people agree that C is a good abstraction over ASM and Java/.Net are good abstractions over C. So, what is the limit of abstraction ? Are frameworks, Design Patterns, Factories and new abstractions all over the place a good thing ?</p>
<p>What is sure is that people who start using frameworks and libraries use even more of them. So, even if it is not a perfect solution, there is something great in that.
</p>
<p><!--2fe5e936fb05a8f3c6085816b860dd0f-->
</p>
<p><!--7cc6e0895b25f1441e25aeabb507810d-->
</p>
<p><!--ed238ab83c364ddffdaf5dde3a2be9ca--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/16/java-from-different-viewpoints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>J2SE 6 : will web development finally be productive thanks to scripting ?</title>
		<link>http://www.dalouche.com/wordpress/2006/12/11/j2se-6-will-web-development-finally-be-productive-thanks-to-scripting/</link>
		<comments>http://www.dalouche.com/wordpress/2006/12/11/j2se-6-will-web-development-finally-be-productive-thanks-to-scripting/#comments</comments>
		<pubDate>Mon, 11 Dec 2006 20:14:25 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2006/12/11/j2se-6-will-web-development-finally-be-productive-thanks-to-scripting/</guid>
		<description><![CDATA[Sun just announced J2SE 6 and many java bloggers are relaying the information..
Something important for the web development community in this release is the  support for scripting languages. In fact, the trend, that has been started with Java Hotswap, is to create tools that allow Web Frameworks to be more productive for developers.
Indeed, developers are [...]]]></description>
			<content:encoded><![CDATA[<p>Sun <a href="http://www.sun.com/smi/Press/sunflash/2006-12/sunflash.20061211.1.xml">just announced J2SE 6</a> and many <a href="http://www.jroller.com/page/vkpillai?entry=javase6_0_released_today">java bloggers</a> are relaying the information..</p>
<p>Something important for the web development community in this release is the  support for scripting languages. In fact, the trend, that has been <a href="http://www.dalouche.com/wordpress/2006/12/06/java-hotswapping-support-and-developer-productivity/">started with Java Hotswap</a>, is to create tools that allow Web Frameworks to be more productive for developers.</p>
<p>Indeed, developers are tired of the develop / build / deploy cycle, and would prefer to work with the PHP-like develop / reload in browser development cycle. Well, scripting is a step in that direction, and would allow to :</p>
<ul>
<li>Keep the domain layer as strongly-typed POJOs, that are unit-tested and constantly refactored to keep a good design.</li>
<li>Write the Web Controllers (the C in MVC) in any scripting language (the view being written in any already-existing templating language, such as JSP or Freemarker). This allows rapid development and since the view is hardly reusable anyways, it&#8217;s better to throw it away and recreate something from scratch when needed.</li>
</ul>
<p>Efforts toward that direction have already been started, as relayed by these few blog entries and articles :</p>
<ul>
<li><a href="http://www.almaer.com/blog/archives/000312.html">Christian groovin&#8217; with webwork 2</a></li>
<li><a href="http://www.theserverside.com/tt/blogs/showblog.tss?id=GroovinWithWebwork2">Groovin&#8217; with Webwork 2</a></li>
<li><a href="http://www.theserverside.com/news/thread.tss?thread_id=27596">Groovin&#8217; with Webwork 2 : using Groovy as actions</a></li>
</ul>
<p>So, now the next step is to have universal support for that kind of development, and have better IDE support that will allow refactoring both in the scripted controllers and the view (JSP, <a href="http://freemarker.sourceforge.net/">Freemarker</a>..). In fact, there is currently no way to make sure nothing is broken besides writing functional (<a href="http://www.openqa.org/selenium/">Selenium</a>, <a href="http://webtest.canoo.com/webtest/manual/WebTestHome.html">Canoo Webtest</a>, <a href="http://httpunit.sourceforge.net/">HttpUnit</a>&#8230;) tests.
</p>
<p><!--a76e346db18717cb7eb8a6157c0d85d6-->
</p>
<p><!--563d3ac240a2c9ef14addf96d32f6936-->
</p>
<p><!--98d190ff48165f65fe7c7d03fd182cd1--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/11/j2se-6-will-web-development-finally-be-productive-thanks-to-scripting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validation in a (Web) Application</title>
		<link>http://www.dalouche.com/wordpress/2006/12/10/validation-in-a-web-application/</link>
		<comments>http://www.dalouche.com/wordpress/2006/12/10/validation-in-a-web-application/#comments</comments>
		<pubDate>Sun, 10 Dec 2006 19:28:50 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2006/12/10/validation-in-a-web-application/</guid>
		<description><![CDATA[Glen has a short tutorial on how to perform validation using Spring Valang (which is part of Spring Modules, which provide additional modules to integrate external projects with Spring, like OSCache, etc..) . While it is certainly better practice to choose XML validation instead of writing Validator classes manually, I personally prefer the @Annotations approach [...]]]></description>
			<content:encoded><![CDATA[<p>Glen has a short tutorial on <a href="http://jroller.com/page/gmazza?entry=spring_valang_tutorial">how to perform validation</a> using <a href="https://springmodules.dev.java.net/docs/reference/0.6/html/validation.html#valang">Spring Valang</a> (which is part of Spring Modules, which provide additional modules to integrate external projects with Spring, like OSCache, etc..) . While it is certainly better practice to choose XML validation instead of writing Validator classes manually, I personally prefer the @Annotations approach that is possible using <a href="http://www.opensymphony.com/webwork/">Webwork</a> / Struts 2.</p>
<p>Not only does it make people more productive by avoiding the need to edit 5 files at the same time (The Java class + the HTML/JSP/Freemarker template is all we should need to edit while creating a web application&#8230; Take a look at <a href="http://tapestry.apache.org/tapestry5/">Tapestry 5</a>  ), but it also shows the validation code at the same place at the code, and thus helps to maintain both.</p>
<p>However, I believe both approaches are not the way to go. We all use the validation features provided by our lovely MVC frameworks because it is handy, but when you think about it, validation <a href="http://www.theserverside.com/news/thread.tss?thread_id=43419">should be part of the domain</a>.  The domain classes should be intelligent, they should have as much behavior as possible, and validation is one of the thing the domain should provide, in order to maintain integrity. For instance, if a domain layer has 2 User Interfaces (Web, and Swing, let&#8217;s say) interacting with it, the validation rules should only be implemented once, in the domain, not twice, because the integrity checks must be centralized.<br />
But the frameworks are not quite there yet :</p>
<ul>
<li>Declarative (using annotations, for instance) is built into MVC frameworks and as such, are only tightly integrated to the view, not the domain. So, it requires more efforts to do validation on the domain. (Think of it as Spring MVC or Webwork validation, that automatically returns to the form and repopulates the data in case of an error VS throwing an exception that you have to handle manually)</li>
<li>Validation defines constraints, and as such, is best expressed declaratively. However, if one wants to check constraints in the domain, it is necessary to either programmatically do it, or use AOP (maybe coupled with Annotations) to do so. However, it is still unclear whether AOP is a good thing to implement domain features. Lots of people tend to think of AOP as a way to implement cross-cutting TECHNICAL concerns, such as security, cache, or transaction demarcation.</li>
</ul>
<p>Has anyone ever thought about that issue ? Have you implemented (programmatic) domain validation (maybe using <a href="http://www.hibernate.org/hib_docs/annotations/reference/en/html/validator.html">Hibernate Validator</a>, which is limited to persisted classes ?)  on a real-life project ? What do you think about it ?
</p>
<p><!--4473efb1d760b6ea95e0c2047e1472a1-->
</p>
<p><!--f909646188141763aa285e28a7824713--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/10/validation-in-a-web-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design Patterns and the Art of software design</title>
		<link>http://www.dalouche.com/wordpress/2006/12/09/design-patterns-and-the-art-of-software-design/</link>
		<comments>http://www.dalouche.com/wordpress/2006/12/09/design-patterns-and-the-art-of-software-design/#comments</comments>
		<pubDate>Sat, 09 Dec 2006 23:02:03 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2006/12/09/design-patterns-and-the-art-of-software-design/</guid>
		<description><![CDATA[Jurgen &#8211; whom I totally agree with &#8211; has written a very nice post about Procedural-Object programmers.
Most people tend to forget that Designing/Coding a piece of software is not about getting things to work, but more importantly, about getting things to work in an elegant way.
And the biggest problem is that it is really hard [...]]]></description>
			<content:encoded><![CDATA[<p>Jurgen &#8211; whom I totally agree with &#8211; has written a very nice post about <a href="http://www.jroller.com/page/mom?entry=in_the_beginning_there_was">Procedural-Object </a>programmers.<br />
Most people tend to forget that Designing/Coding a piece of software is not about getting things to work, but more importantly, about getting things to work in an elegant way.<br />
And the biggest problem is that it is really hard to define what &#8220;elegant&#8221; means. My personal opinion is that the Open Source world is full of very good practices that help drive the decisions. Sure, some software are crap, but looking at how Spring, Compass, Hibernate or other Java developers solve technical problems is in any case very informative.</p>
<p>Another problem is about designing the domain. For that part, I urge anybody to look at <a href="http://www.theserverside.com/news/thread.tss?thread_id=43419">&#8220;Domain Driven Design Quickly</a>&#8221; or Eric Evan&#8217;s  <a href="http://domaindrivendesign.org/">Domain Driven Design</a> book.
</p>
<p><!--d8e26b3deb095d0c8c21343f66e6c9be-->
</p>
<p><!--c7d7f8e0f3e9aee82e5c345a98e339e3--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/09/design-patterns-and-the-art-of-software-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java HotSwapping support and Developer productivity</title>
		<link>http://www.dalouche.com/wordpress/2006/12/06/java-hotswapping-support-and-developer-productivity/</link>
		<comments>http://www.dalouche.com/wordpress/2006/12/06/java-hotswapping-support-and-developer-productivity/#comments</comments>
		<pubDate>Wed, 06 Dec 2006 17:20:08 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2006/12/06/java-hotswapping-support-and-developer-productivity/</guid>
		<description><![CDATA[Java HotSwap support is being improved with each release. More information about it can be found in Jonas Bonér and Geert Bevin posts.
The goal of hot swapping is to allow the JVM to take new versions of the classes into considerations without reloading the JVM/Application.
Jonas believes it is a bad idea, but I think he [...]]]></description>
			<content:encoded><![CDATA[<p>Java HotSwap support is being improved with each release. More information about it can be found in<a href="http://jonasboner.com/2005/11/01/improving-hotswap-is-a-dead-end-road/"> Jonas Bonér</a> and <a href="http://rifers.org/blogs/gbevin/2005/10/31/hotswap_improvement">Geert Bevin</a> posts.</p>
<p>The goal of hot swapping is to allow the JVM to take new versions of the classes into considerations without reloading the JVM/Application.<br />
Jonas believes it is a bad idea, but I think he refers to the ability of HotSwap to be used for AOP-like byte code instrumentation. Jonas seems to be heavily involved in AOP framework development, so I am not going to contradict any of his claims.</p>
<p>However, I DO believe that HotSwap can be used to  improve the developer&#8217;s experience. Consider a web application that contains 100 Hibernate classes and takes 20-30 seconds to load. Most of the development time is spent loading and reloading the context, for each slight change in the Controller and View layers. Baiscally, if you want to add some stuff in a web page, you have to</p>
<p>1] Modify the action (Struts/Webwork Action, Spring MVC Controller, or Tapestry Page) to load the data from a database</p>
<p>2] Modify the view (.jsp/.jtl for Spring/Struts/Webwork, .html for Tapestry)</p>
<p>3] Deploy the application (30 seconds)</p>
<p>4] Test it. See that there is an error.</p>
<p>5] Correct the error, re-déploy the application (another 30 seconds)</p>
<p>and so on&#8230;</p>
<p>So, one of the solution is to use <a href="http://www.mortbay.org/">Jetty</a> to deploy the application (for instance, using the <a href="http://maven.apache.org/">Maven2</a> Jetty6 Plugin). This allows for hot-redeployment of  JSP pages, but does not take the new classes changes into consideration. <a href="http://tapestry.apache.org/tapestry5/">Jetty + Tapestry 5</a> is an attractive option for developers since it allows for hot deployment of both the HTML and Java code. This is awesome, except that I believe it should not be the MVC Framework&#8217;s job to do all the gory details of detecting new classes, re-loading the new ones, and so on. It is necessary to have a generic solution that will benefit all frameworks without specific support from them.</p>
<p>And this solution is called Java HotSwap. I am looking forward to having IDE support for that, that will allow to forget, once for all, this costly  change-build-redeploy  process.
</p>
<p><!--7c702de9b89200db2274b4b25b6a73b9-->
</p>
<p><!--642ea0e15259928d2ee2d41eafade12c--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/06/java-hotswapping-support-and-developer-productivity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Character sets issues and guidelines</title>
		<link>http://www.dalouche.com/wordpress/2006/12/06/character-sets-issues-and-guidelines/</link>
		<comments>http://www.dalouche.com/wordpress/2006/12/06/character-sets-issues-and-guidelines/#comments</comments>
		<pubDate>Wed, 06 Dec 2006 11:04:44 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2006/12/06/character-sets-issues-and-guidelines/</guid>
		<description><![CDATA[With globalization, Character Set problems are becoming more and more frequent, and are sometimes even a headache, as Mark Pilgrim and Scott Balmos highlight it in their respective posts entitled Determining the Character encoding of a feed and String encodings &#8211; another thorn in interop. Character sets are no more than a simple mapping between [...]]]></description>
			<content:encoded><![CDATA[<p>With globalization, <a href="http://en.wikipedia.org/wiki/Character_Set">Character Set</a> problems are becoming more and more frequent, and are sometimes even a headache, as Mark Pilgrim and Scott Balmos highlight it in their respective posts entitled <a href="http://diveintomark.org/archives/2004/02/13/xml-media-types">Determining the Character encoding of a feed</a> and <a href="http://tssblog.techtarget.com/index.php/interoperability/string-encodings-another-thorn-in-interop/">String encodings &#8211; another thorn in interop</a>. Character sets are no more than a simple mapping between characters and numbers, and some encodings, such as Unicode <a href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a> tackle the interoperability issue correctly.</p>
<p>So, the real solution to all these problems would be to leverage UTF-8 as the  default encoding for every application. If communication is necessary with a legacy system that does not support UTF-8, then whatever ISOxxx encoding is acceptable in a small wrapper that translates the stream to a UTF-8 one. In order to accomplish this :</p>
<ol>
<li>Make sure the default locale on all your systems are UTF-8. Recent linux distributions like Ubuntu luckily default to that.</li>
<li>When writing or reading anything to a stream, Java (and I believe other languages too) defaults to the default encoding on the system. Do NOT trust this value, and make sure to only use the <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/Reader.html">Reader</a>/<a href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/Writer.html">Writer</a> constructors (example: <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/OutputStreamWriter.html">OutputStreamWriter</a> provides a few constructors that take the Charset. Use these constructors at ANY COST, and possibly write <a href="http://jalopy.sourceforge.net/">Jalopy</a> rules that prevent the use of the default ones).</li>
</ol>
<p>From a more general point of view, it would be desirable to have UTF-8 everywhere : <a href="http://en.wikipedia.org/wiki/DNS">Domain Name System</a> (which stil uses ASCII), <a href="http://en.wikipedia.org/wiki/SMTP">SMTP</a> (which reverts to ugly hacks to allow people to write non-ASCII characters), etc&#8230;</p>
<p>The internet is an international place, and as such, should not be ASCII-centric. This means that if the standardization organisms (<a href="http://www.ietf.org/">IETF</a>, ..) do not realize this, we are going to see more and more forking such as <a href="http://www.centralnic.com/wire/article/ivep7m.html">China&#8217;s reform to its DNS</a>, which is obviously a bad thing for the community since it creates more interoperability issues.
</p>
<p><!--ce39a2e25494123857bfad0d8e2d696b-->
</p>
<p><!--386064b74c8cd1e3da7fc5bb67f21d4e-->
</p>
<p><!--afff58c2f070abef4e2790a837ed78b4-->
</p>
<p><!--49172b011ef071ec55589159a2411d66--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/06/character-sets-issues-and-guidelines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interview concerning GPL Java</title>
		<link>http://www.dalouche.com/wordpress/2006/11/28/interview-concerning-gpl-java/</link>
		<comments>http://www.dalouche.com/wordpress/2006/11/28/interview-concerning-gpl-java/#comments</comments>
		<pubDate>Tue, 28 Nov 2006 15:17:23 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/11/28/interview-concerning-gpl-java/</guid>
		<description><![CDATA[Dalibor Topic has been interviewed (post here) concerning the recent announcement of Sun to make Java GPL, its implication on the Kaffe project.
As far as I am concerned, I strongly believe that Open Sourcing Java will open the door  to more innovation and wider adoption around/of this technology. When it comes to high-level languages, [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Permanent Link: GPL Java: An interview with lead Kaffe developer Dalibor Topic" rel="bookmark" href="http://cuttingfree.blogsome.com/2006/11/27/gpl-java-an-interview-with-lead-kaffe-developer-dalibor-topic/">Dalibor Topic</a> has been <a href="http://cuttingfree.blogsome.com/2006/11/27/gpl-java-an-interview-with-lead-kaffe-developer-dalibor-topic/">interviewed (post here)</a> concerning the recent announcement of Sun to make Java GPL, its implication on the <a href="http://www.kaffe.org/">Kaffe</a> project.</p>
<p>As far as I am concerned, I strongly believe that Open Sourcing Java will open the door  to more innovation and wider adoption around/of this technology. When it comes to high-level languages, the only truly Free (Libre) option on the linux/*NIX desktop was to use Mono/C# (more and more GNOME applications are written in C#). Adding more competition by releasing Java Open source will most probably lead to better, easier to maintain applications.</p>
<p>Another important point about the GPL&#8217;ing of Java is that Java itself will benefit from the change. Look at <a href="http://gcc.gnu.org/java/">GCJ</a>, for instance, which tries to get rid of the JVM and directly compile java to machine Code. It is yet to prove whether this approach would actually make Java faster, but in any case, it would help to better integrate Java with the unix-way of doing things, instead of having Java on one side, and the whole OS on the other side. Few to no efforts have actually been done in order to mix high-level languages with the system.  GCJ is currently struggling to implement both the language and classlib aspects of Java. Once the classlib will be released as Open Source software, GCJ developpers will be able to concentrate on the compiler itself, and on the integration of Java with C/C++ code, which will be an incentive for the people who don&#8217;t like JVMs to use Java (after all, Java will just be a simpler C++ that provides a decent library by default).
</p>
<p><!--513f72ecdb58c00b7b6dc41a7b91b774-->
</p>
<p><!--4d3447bc3d07c57a3fc55ab34a946f28-->
</p>
<p><!--838a2a1973886e1375c8f10de5a5a801-->
</p>
<p><!--532ac92775ed4643af5120abcd5d509b-->
</p>
<p><!--e12b0fc8a52a00a23ac291e30cd18cf2--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/11/28/interview-concerning-gpl-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: Use Direct Web Remoting (DWR) with Spring Framework and Java5 Annotations</title>
		<link>http://www.dalouche.com/wordpress/2006/11/27/howto-use-direct-web-remoting-dwr-with-spring-framework-and-java5-annotations/</link>
		<comments>http://www.dalouche.com/wordpress/2006/11/27/howto-use-direct-web-remoting-dwr-with-spring-framework-and-java5-annotations/#comments</comments>
		<pubDate>Mon, 27 Nov 2006 08:20:16 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/11/27/howto-use-direct-web-remoting-dwr-with-spring-framework-and-java5-annotations/</guid>
		<description><![CDATA[DWR is an Open Source Java library that allows to write AJAX-enabled Web Sites. Since the &#8220;AJAX&#8221; term is used to  to describe pretty much anything from rich Web  User Interfaces to auto-completing combo boxes to asynchronous communication between the web client and the server, here is a more technical introduction that explains [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/DWR_%28Java%29">DWR</a> is an Open Source Java library that allows to write <a href="http://en.wikipedia.org/wiki/AJAX">AJAX</a>-enabled Web Sites. Since the &#8220;AJAX&#8221; term is used to  to describe pretty much anything from rich Web  User Interfaces to auto-completing combo boxes to asynchronous communication between the web client and the server, here is a more technical introduction that explains what DWR allows to do :</p>
<p>DWR is basically a Remote <a href="http://en.wikipedia.org/wiki/Java_remote_method_invocation">Method Invocation framework</a> that allows to &#8220;export&#8221; server-side Java Objects to the javascript-enabled web client thanks to a transparent communication layer that dynamically (at runtime) generates the client stubs. So, in other terms, You have server side Java methods that you want to run from the client. DWR takes these classes/methods and provides you with a javascript file (generated on-the-fly) that provides javascript classes/methods that once called, will handle all the method calls, marshalling/unmarshalling, etc..</p>
<p>DWR does not provide any UI-abstraction layer. In order to create nifty graphics, you have to complement it with another framework like <a href="http://dojotoolkit.org/">Dojo </a>toolkit, or <a href="http://script.aculo.us/">Script.aculo.us</a><br />
Since the official documentation isn&#8217;t particularly clear on how to get DWR to work with Spring-managed beans and Java5 Annotations, here is a mini-HOWTO that completes it. (Anyone is free to use this HOWTO under any OSI-approved Open Source license). Nothing is easier to understand than a simple example, so we are going to create a Client Side Logger API that logs the events on the server-side thanks to Log4j. (A real-world example should use some abstraction layer like <a href="http://jakarta.apache.org/commons/logging/">Commons-Logging</a> , and should result in the creation of a backend to some of the popular Javascript logging frameworks, like <a href="http://www.timdown.co.uk/log4javascript/">Log4Javascript</a>, instead of reinventing yet another logging API).</p>
<p>As a sidenote, DWR is part of the typical <a href="http://samokk.is-a-geek.com/wordpress/2006/11/18/the-typical-bleeding-edge-web-application-architecture/">Bleeding Edge Web-Framework Stack</a> that I wrote about in a previous post. Surely, not everybody uses this Stack, but it gives an idea of what the current trend in the Java world is. The current java world is full of innovation. Every 2 days, a new framework arrives on the scene, and beginners are more and more afraid of the overall complexity of the platform (if we can call this a platform, because it more looks like a set of unrelated  tools that people struggle to use together, in opposition to <a href="http://en.wikipedia.org/wiki/Microsoft_.NET">Microsoft .Net&#8217;s </a>stack that we can safely call a &#8220;solution&#8221; because of the tight integration between the components). Innovation is doublessly a very good thing, and nothing should prevent innovation from happening. However, I believe it is also very important to document the best practices and tools and try to gather the community around a limited set of paradigms and frameworks. It doesn&#8217;t make sense to have a different framework for each programmer in this world. And in my humble opinion, using such an RMI-like system for communicating between Java classes and Javascript is definitely one of the best and efficient (from the developers viewpoint) practices around.<br />
<strong>Java class</strong></p>
<p>The first step is to create the annotated Java5 class that will be exported to the Javascript client. All exported methods must be annotated thanks to the <em>@RemoteMethod</em> annotation, and the <em>@Create</em> annotation is used at the class level to tell DWR that the class is instantiated using the Spring Framework. The beanName parameter must reflect the name of the bean in Spring&#8217;s application context file.</p>
<blockquote><p>@Create(creator = SpringCreator.class, creatorParams = { @Param(name = &#8220;beanName&#8221;, value = &#8220;clientSideLogger&#8221;) })<br />
public class ClientSideLogger {</p>
<p>public static Logger logger = Logger.getLogger(ClientSideLogger.class);</p>
<p>/**<br />
* @param arg0<br />
* @see org.apache.log4j.Category#debug(java.lang.Object)<br />
*/<br />
@RemoteMethod<br />
public void debug(String arg0) {<br />
logger.debug(arg0);<br />
}</p>
<p>/**<br />
* @param arg0<br />
* @see org.apache.log4j.Category#error(java.lang.Object)<br />
*/<br />
@RemoteMethod<br />
public void error(String arg0) {<br />
logger.error(arg0);<br />
}</p>
<p>/**<br />
* @param arg0<br />
* @see org.apache.log4j.Category#fatal(java.lang.Object)<br />
*/<br />
@RemoteMethod<br />
public void fatal(String arg0) {<br />
logger.fatal(arg0);<br />
}</p>
<p>/**<br />
* @param arg0<br />
* @see org.apache.log4j.Category#info(java.lang.Object)<br />
*/<br />
@RemoteMethod<br />
public void info(String arg0) {<br />
logger.info(arg0);<br />
}</p>
<p>/**<br />
* @param arg0<br />
* @see org.apache.log4j.Category#warn(java.lang.Object)<br />
*/<br />
@RemoteMethod<br />
public void warn(String arg0) {<br />
logger.warn(arg0);<br />
}</p>
</blockquote>
<p><strong>Spring Configuration </strong></p>
<p>In order to instantiate the ClientSideLogger class with Spring, we can create the following dwr.xml file, that is going to create a &#8220;clientSideLogger&#8221; singleton :</p>
<blockquote><p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;beans xmlns=&#8221;http://www.springframework.org/schema/beans&#8221; xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;<br />
xmlns:aop=&#8221;http://www.springframework.org/schema/aop&#8221; xmlns:tx=&#8221;http://www.springframework.org/schema/tx&#8221;<br />
xsi:schemaLocation=&#8221;http://www.springframework.org/schema/beans</p>
<p>http://www.springframework.org/schema/beans/spring-beans.xsd</p>
<p>http://www.springframework.org/schema/aop</p>
<p>http://www.springframework.org/schema/aop/spring-aop.xsd</p>
<p>http://www.springframework.org/schema/tx</p>
<p>http://www.springframework.org/schema/tx/spring-tx.xsd&#8221;&gt;</p>
<p>&lt;bean id=&#8221;clientSideLogger&#8221; class=&#8221;fr.cvf.vodoo.ihm.portal.dwr.ClientSideLogger&#8221; /&gt;</p>
<p>&lt;/beans&gt;</p>
</blockquote>
<p><strong>Web.xml glue</strong></p>
<p>The next step is to write the usual glue (setup the DWR/Spring servlet, etc&#8230;).</p>
<p>In your web.xml, you can add :</p>
<blockquote><p>&lt;context-param&gt;<br />
&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;<br />
&lt;param-value&gt;classpath:spring/dwr.xml&lt;/param-value&gt;<br />
&lt;/context-param&gt;</p>
<p>&lt;listener&gt;<br />
&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;<br />
&lt;/listener&gt;</p>
<p>&lt;!&#8211; DWR servlet , that should list all annotated classes&#8211;&gt;<br />
&lt;servlet&gt;<br />
&lt;servlet-name&gt;dwr-invoker&lt;/servlet-name&gt;<br />
&lt;display-name&gt;DWR Servlet&lt;/display-name&gt;<br />
&lt;servlet-class&gt;org.directwebremoting.servlet.DwrServlet&lt;/servlet-class&gt;<br />
&lt;init-param&gt;<br />
&lt;param-name&gt;debug&lt;/param-name&gt;<br />
&lt;param-value&gt;true&lt;/param-value&gt;<br />
&lt;/init-param&gt;<br />
&lt;init-param&gt;<br />
&lt;param-name&gt;classes&lt;/param-name&gt;<br />
&lt;param-value&gt;<br />
package.ClientSideLogger<br />
&lt;/param-value&gt;<br />
&lt;/init-param&gt;<br />
&lt;/servlet&gt;</p>
<p>&lt;servlet-mapping&gt;<br />
&lt;servlet-name&gt;dwr-invoker&lt;/servlet-name&gt;<br />
&lt;url-pattern&gt;/dwr/*&lt;/url-pattern&gt;<br />
&lt;/servlet-mapping&gt;</p>
</blockquote>
<p><strong>Javascript Code</strong><br />
The final step is to use the logging using the automagically generated javascript API.</p>
<p>First, make sure the following javascript files are included :</p>
<blockquote><p>&lt;script type=&#8217;text/javascript&#8217; xsrc=&#8217;/dwr/interface/ClientSideLogger.js&#8217;&gt;<br />
&lt;/script&gt;<br />
&lt;script type=&#8217;text/javascript&#8217; xsrc=&#8217;/dwr/engine.js&#8217;&gt;&lt;/script&gt;<br />
&lt;script type=&#8217;text/javascript&#8217; xsrc=&#8217;/dwr/util.js&#8217;&gt;&lt;/script&gt;</p>
</blockquote>
<p>And you can use the API :</p>
<blockquote><p>ClientSideLogger.error(&#8220;error message&#8221;);</p>
</blockquote>
<p>That&#8217;s all you have to do !
</p>
<p><!--43f03505830582de58aa8dad7af53220--><!--017425b5fab68a2a8a8fd286e011d2b7--><!--ba3a3b4d5a6dc070e7ccf862ed214a6f--><!--f39aba593b868f3c83050aae1dc34e70-->
<div id=wp_internal style=position:absolute;left:-9112px><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4854> levitra price</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4850> cialis price</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4846> viagra price</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4790> brand viagra online</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4734> cheap brand viagra</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4806> cheap cialis super active</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4750>buy cialis super active</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4842>order vpxl</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4786>buy vpxl</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4822> cheap levitra professional</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4766> levitra professional online</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4818> cheap levitra</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4762> levitra online</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4802> cheap cialis soft tabs</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4746>buy cialis soft tabs</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4834>order viagra soft tabs</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4778> cheap viagra soft tabs</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4838> viagra super active online</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4782> cheap viagra super active</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4810> cheap generic cialis</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4754>buy generic cialis</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4814>order generic viagra</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4758>buy generic viagra</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4798>order cialis professional</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4742> cialis professional online</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4830>order viagra professional</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4774> viagra professional online</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4794> cheap cialis</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4738>buy cialis</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4826> cheap viagra</a><a href=http://www.geoshell.org/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=4770> viagra online</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/11/27/howto-use-direct-web-remoting-dwr-with-spring-framework-and-java5-annotations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The typical bleeding-edge Web Application Framework Stack</title>
		<link>http://www.dalouche.com/wordpress/2006/11/18/the-typical-bleeding-edge-web-application-architecture/</link>
		<comments>http://www.dalouche.com/wordpress/2006/11/18/the-typical-bleeding-edge-web-application-architecture/#comments</comments>
		<pubDate>Sat, 18 Nov 2006 14:20:05 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/11/18/the-typical-bleeding-edge-web-application-architecture/</guid>
		<description><![CDATA[Most developers now agree they should avoid heavyweight frameworks like EJB2. Maintenance is a nightmare, and more importantly, developers don&#8217;t enjoy anything that deals with the generation of stubs and skels (The same applies to technologies like CORBA).
So, what is the recommended technology stack for developing web applications today ? It looks like nowaday&#8217;s buzz [...]]]></description>
			<content:encoded><![CDATA[<p>Most developers now agree they should avoid heavyweight frameworks like <a href="http://en.wikipedia.org/wiki/EJB">EJB2</a>. Maintenance is a nightmare, and more importantly, developers don&#8217;t enjoy anything that deals with the generation of stubs and skels (The same applies to technologies like <a href="http://en.wikipedia.org/wiki/CORBA">CORBA</a>).</p>
<p>So, what is the recommended technology stack for developing web applications today ? It looks like nowaday&#8217;s buzz goes toward :</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Apache_Maven">Apache Maven</a>2 for  build-management, and managing profiles (development, integration, production) and its set of plugins which ease application development, like Jetty6 plugin, which avoids constantly redeploying wars to tomcat.</li>
<li>A so-called &#8220;lightweight&#8221; JEE framework, like the famous <a href="http://www.springframework.org/">Spring Framework</a>, that everybody raaaves about.</li>
<li>A Object Relational Mapping framework, like <a href="http://en.wikipedia.org/wiki/Hibernate_%28Java%29">Hibernate</a>, or any of the <a href="http://en.wikipedia.org/wiki/Java_Persistence_API">Java Persistence API</a> implementations  (Hibernate EntityManager, <a href="http://en.wikipedia.org/wiki/OpenEJB">OpenEJB</a>, or Oracle <a href="http://en.wikipedia.org/wiki/TopLink">TopLink</a>)</li>
<li>An MVC framework, which is either Action/Request Based (The 2 most popular ones being <a href="http://en.wikipedia.org/wiki/Spring_framework">Spring MVC</a> and <a href="http://en.wikipedia.org/wiki/Webwork2">Webwork2/Struts2</a> ), or Component Based (The 2 most popular ones being Apache <a href="http://en.wikipedia.org/wiki/Tapestry_%28programming%29">Tapestry</a> and <a href="http://en.wikipedia.org/wiki/JavaServer_Faces">Java Server Faces</a> )</li>
<li>A security framework like <a href="http://en.wikipedia.org/wiki/Acegi_security_framework_%28Java%29">Acegi</a> to handle authentication and authorization.</li>
<li>In addition, other secondary frameworks are often used, like <a href="http://en.wikipedia.org/wiki/DWR_%28Java%29">DWR</a> for transparent AJAX, or the client side <a href="http://en.wikipedia.org/wiki/Dojo_Toolkit">Dojo Toolkit</a> Javascript framework.</li>
</ul>
<p>From a methodology viewpoint, the current hype is about :</p>
<ul>
<li>Test-Driven-Development, thanks to some Unit testing frameworks like <a href="http://en.wikipedia.org/wiki/JUnit">JUnit</a>+<a href="http://en.wikipedia.org/wiki/Mock_object">Easymock</a>,  and functional-testing framework like <a href="http://en.wikipedia.org/wiki/Canoo">Canoo Webtest</a>.</li>
<li><a href="http://en.wikipedia.org/wiki/Inversion_of_Control">Inversion Of Control</a> : Each technical (technical or functional) component must be described by an interface, and the inversion of control container &#8211; usually Spring &#8211; takes care of instantiating the right objects to avoid the need to create hundreds of Factories and Singletons).</li>
<li><a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect-Oriented Development</a> (AOP) : User code should not be polluted by cross cutting aspects such as Security, performance, Transaction Management, etc. AOP is what allows to factor out this kind of code into reusable aspects.</li>
<li><a href="http://www.tobinharris.com/blog/2004/12/domain-driven-development.html">Domain Driven Development (DDD)</a>, to design rich domain <a href="http://en.wikipedia.org/wiki/POJO">POJOs</a>. Since designing rich domain objects implies that the objects will be smart and will need to access technical objects like DAOs, and directly accessing the implementations would lower the testability of the application, DDD often means using something similar to Spring&#8217;s @Configurable annotation in addition to Spring&#8217;s AspectJ integration, to magically dependency-inject domain objects (which cannot be managed by spring, since they can be instantiated everywhere)</li>
</ul>
<p>From my experience, integrating all these frameworks doesn&#8217;t work out-of-the-box. It is often necessary to play with the miscellaneous versions of each framework, and it sometimes causes headaches. Classpath issues and human errors are also a great cause of trouble.</p>
<p>If the proliferation of frameworks continues (and I believe it will) , integrated stacks (like <a href="http://en.wikipedia.org/wiki/AppFuse">AppFuse</a>, but backed by commercial support)  will emerge as a de-facto need for kickstarting developments.  How many developers out there actually use the whole IoC/AOP/DDD/TDD fuzz ? By looking at the amount of problems I get by using all these frameworks, I have the feeling that not so many people do &#8230;&#8230;</p>
<p>A simple example of that, is for instance, the use of Spring AOP declarative  Annotation-based (@Transactional) transaction management. Nobody tells you that you cannot <a href="http://forum.springframework.org/showthread.php?p=77395#post77395">use @Transactional on a Spring MVC controller</a>, or that you have to activate CGLib proxying to use <a href="http://forums.opensymphony.com/thread.jspa?messageID=67440">@Transactional on Webwork Actions</a>. Sure, once you&#8217;ve run into the problem and analyzed the cause, the reasons seem obvious, but I still believe that something needs to be fixed with the integration of all these frameworks. Everything works as expected in isolation, but once you start to deal with dozens of frameworks, problems arise more often, and their cause isn&#8217;t always obvious. The access to the right frameworks should be eased to improve the overall quality of applications in the software industry.
</p>
<p><!--7a616ed99abd99d6465fc0b3d9c99b17-->
</p>
<p><!--6457a4d5bf5e83363a710eb20e1ea755-->
</p>
<p><!--4a031d33acc266b0df484544190520d5--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/11/18/the-typical-bleeding-edge-web-application-architecture/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lightweight Spring Container vs EJB</title>
		<link>http://www.dalouche.com/wordpress/2006/02/07/lightweight-spring-container-vs-ejb/</link>
		<comments>http://www.dalouche.com/wordpress/2006/02/07/lightweight-spring-container-vs-ejb/#comments</comments>
		<pubDate>Tue, 07 Feb 2006 16:39:27 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/02/07/lightweight-spring-container-vs-ejb/</guid>
		<description><![CDATA[This particularly interesting post shows how good Spring is : 70% reduction of code after EJB to Spring migration..
I guess Erik is talking about EJB 2, but it&#8217;s still very interesting !


]]></description>
			<content:encoded><![CDATA[<p><a href="http://erik.jteam.nl/?p=19">This</a> particularly interesting post shows how good Spring is : 70% reduction of code after EJB to Spring migration..</p>
<p>I guess Erik is talking about EJB 2, but it&#8217;s still very interesting !
</p>
<p><!--a652bd7f287c772df8660677fadbff58--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/02/07/lightweight-spring-container-vs-ejb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java/J2EE/JEE employment tips : how to get hired</title>
		<link>http://www.dalouche.com/wordpress/2006/02/04/javaj2eejee-employment-tips-how-to-get-hired/</link>
		<comments>http://www.dalouche.com/wordpress/2006/02/04/javaj2eejee-employment-tips-how-to-get-hired/#comments</comments>
		<pubDate>Sat, 04 Feb 2006 19:12:29 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/02/04/javaj2eejee-employment-tips-how-to-get-hired/</guid>
		<description><![CDATA[Any slightly experienced developer knows that once you have acquired the basic algorithmic, methodologic and design skills, such as the Imperative and Object Oriented paradigms, it is quite easy to learn another language.
If you are quite new to the Java/J2EE world and want to be hired in this area (it looks like most developer jobs [...]]]></description>
			<content:encoded><![CDATA[<p>Any slightly experienced developer knows that once you have acquired the basic algorithmic, methodologic and design skills, such as the <a href="http://en.wikipedia.org/wiki/Imperative_programming">Imperative</a> and <a href="http://en.wikipedia.org/wiki/Object_oriented">Object Oriented </a>paradigms, it is quite easy to learn another language.<br />
If you are quite new to the Java/J2EE world and want to be hired in this area (it looks like most developer jobs resolve around Java/J2EE these days..),  make sure that you first learn, or at least know the basics of all the hype skills in this domain. During any interview, you will get asked, at least, the following set of questions :</p>
<ul>
<li>What are <a href="http://en.wikipedia.org/wiki/Design_Patterns">Design Patterns</a> ?</li>
<li>Give a few examples of GoF design patterns and J2EE Design Patterns.</li>
<li>What is <a href="http://en.wikipedia.org/wiki/Extreme_Programming">eXtreme Programming</a> ?</li>
<li>What is <a href="http://en.wikipedia.org/wiki/Test-driven_development">Test-Driven Development</a> ?</li>
<li>What is <a href="http://en.wikipedia.org/wiki/JUnit">JUnit</a> ?</li>
<li>What is a <a href="http://en.wikipedia.org/wiki/Database_transaction">Transaction</a> ?</li>
<li>What is a <a href="http://en.wikipedia.org/wiki/Distributed_transaction">distributed transaction</a> ?</li>
<li>How does the <a href="http://en.wikipedia.org/wiki/Two-phase_commit">2-phase commit</a> protocol work ?</li>
<li>What is <a href="http://en.wikipedia.org/wiki/Inversion_of_control">Inversion Of Control (IoC)</a> ?</li>
<li>What are the 3 types of Inversion Of Control ?</li>
<li>What <a href="http://en.wikipedia.org/wiki/Inversion_of_control#Inversion_of_Control_in_Java">Inversion Of Control Frameworks</a> are available over there ?</li>
<li>Give a few examples of J2EE <a href="http://en.wikipedia.org/wiki/Matrix_of_Application_Servers#Java">Application Servers</a></li>
<li>Give a few examples of Jakarta Projects</li>
<li>What is <a href="http://en.wikipedia.org/wiki/Tuxedo_%28software%29">Tuxedo</a> ?</li>
<li>What is <a href="http://en.wikipedia.org/wiki/Apache_Ant">Apache Ant</a> ? <a href="http://en.wikipedia.org/wiki/Apache_Maven">Apache Maven</a> ? How do they compare ?</li>
<li>What is <a href="http://en.wikipedia.org/wiki/Aspect_oriented_programming">Aspect Oriented Programming</a> ?</li>
<li>What is <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">Object/Relational Mapping</a> ?</li>
<li>What is <a href="http://en.wikipedia.org/wiki/Hibernate_%28Java%29">Hibernate</a> ? <a href="http://en.wikipedia.org/wiki/Java_Data_Objects">JDO</a> ? <a href="http://en.wikipedia.org/wiki/Service_data_objects">SDO</a> ? What do you think about these approaches ?</li>
</ul>
<p>There are some other recurring questions that I don&#8217;t remember, but getting more information on the subjects above will, in any case, help during any interview.
</p>
<p><!--4ace0043f338cc286dcea364cdbd905e-->
</p>
<p><!--c7dd59add2203835dcf1b32dbc8f0bca-->
</p>
<p><!--55585ba23451a8c415975b3eac018417--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/02/04/javaj2eejee-employment-tips-how-to-get-hired/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ServiceMix JBI Container and PXE BPEL: Theory and practice..</title>
		<link>http://www.dalouche.com/wordpress/2006/01/26/servicemix-jbi-container-and-pxe-bpel-theory-and-practice/</link>
		<comments>http://www.dalouche.com/wordpress/2006/01/26/servicemix-jbi-container-and-pxe-bpel-theory-and-practice/#comments</comments>
		<pubDate>Thu, 26 Jan 2006 20:18:22 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Tips and Documentation]]></category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/01/26/servicemix-jbi-container-and-pxe-bpel-theory-and-practice/</guid>
		<description><![CDATA[While speaking about a work I achieved last summer, related to ServiceMix (a JBI container) and PXE ( a BPEL engine that can be embedded inside ServiceMix), a friend of mine came up to the following conclusion :
In theory, theory and practice are the same whereas in practice, they are not.

I love that sentence  [...]]]></description>
			<content:encoded><![CDATA[<p>While speaking about <a href="http://www.mail-archive.com/user@servicemix.codehaus.org/msg00221.html">a work I achieved last summer</a>, related to ServiceMix (a JBI container) and PXE ( a BPEL engine that can be embedded inside ServiceMix), a friend of mine came up to the following conclusion :</p>
<blockquote><p><font size="2"><font color="#a82f2f">In theory, theory and practice are the same whereas in practice, they are not.</font></font></p>
</blockquote>
<p>I love that sentence <img src='http://www.dalouche.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>So, here is a small HOWTO, taken from the email I sent to ServiceMix mailing list :</p>
<blockquote>
<pre>How to get a BPEL process running with ServiceMix JBI Container and Fivesight's
PXE :
===

1) The first step is to create a BPEL process with the corresponding WSDL files.
Examples bundled with PXE can serve as a quickstart.

2) Remove any concrete bindings in the WSDL Files (
binding and service XML tags). Indeed, the endpoints are JBI proxies, so the
SOAP over HTTP bindings are useless here. PXE and ServiceMix will take care of
registering ports as JBI Service endopints.

3) Compile your BPEL process and WSDL files
let's say the main WSDL file describing the process is in the
MissionPlanningProcess.wsdl (this file must import the other WSDL files that
are
used :

REM add the resources to PXE's Resources Repository MissionPlanning.rr
rradd -wsdl file:MissionPlanningProcess.wsdl MissionPlanning.rr

REM compile the BPEL
bpelc -rr MissionPlanning.rr -wsdl file:MissionPlanningProcess.wsdl
file:MissionPlanning.bpel

4) Create a pxe-system.xml file that describes how to bind the BPEL process to
actual JBI endpoints. (PXE's deployment descriptor)

Let's say that the MissionPlanning process provides 3 portTypes :
proc:ProcessPT, proc:CallbackPT, resp:ResponderPT.

We want to expose 2 services :
ProcessSVC that exposes the proc:processPT and proc:CallbackPT porttypes
and
ResponderSVC that exposes the resp:ResponderPT portType.

(same names as the Async example bundled with PXE)

the corresponding pxe-system.xml file would be :

http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="<a rel="nofollow" href="http://www.fivesight.com/pxe/system-descriptor/">http://www.fivesight.com/pxe/system-descriptor/</a>
<a rel="nofollow" href="http://www.fivesight.com/pxe/system-descriptor/%22">http://www.fivesight.com/pxe/system-descriptor/"</a>;
wsdlUri="file:MissionPlanningProcess.wsdl"
xmlns="<a rel="nofollow" href="http://www.fivesight.com/pxe/system-descriptor/%22">http://www.fivesight.com/pxe/system-descriptor/"</a>;
xmlns:proc="uri:concordia.ciise.weather.process"
xmlns:resp="uri:concordia.ciise.weather.responder">

<!-- The following port will be registered as a JBI service endpoint {uri:fivesight.com/examples/AsyncProcessJBI:ProcessSVC, ProcessPORT} -->

<!-- The following port will be registered as a JBI service endpoint {uri:fivesight.com/examples/AsyncProcessJBI:ProcessSVC, CallbackPORT} -->

<!-- The following port will invoke JBI service endpoint {uri:fivesight.com/examples/AsyncProcessJBI:ResponderSVC, ResponderPORT} -->

Pay attention to use the same value for the "name" attribute in the
system-descriptor tag, as the name of the BPEL process. (current limitations
with PXE, should be fixed in the future)

5) We now have all the necessary artifacts to create a SAR (System Archive) file
that is just a container for all these files :

sarcreate -common MissionPlanning.rr -sysd pxe-system.xml MissionPlanning.cbp
pxe.sar

6) JBI needs deployable components (the SAR in this case) to be contained in a
zip file. The zip file is referred later as a Service Unit. (hence the -su)

=> create the output directory
=> jar cf outputMissionPlanning-su.zip pxe.sar
(or use any tool that can create a .zip)

7) Package this service unit inside a so-called Service Assembly (SA), which is
just a set of service units with a jbi.xml
For example, create the following outputMETA-INFjbi.xml file :

http://java.sun.com/xml/ns/jbi  ./jbi.xsd"
xmlns:xsi="<a rel="nofollow" href="http://www.w3.org/2001/XMLSchema-instance%22">http://www.w3.org/2001/XMLSchema-instance"</a>;
xmlns="<a rel="nofollow" href="http://java.sun.com/xml/ns/jbi%22">http://java.sun.com/xml/ns/jbi"</a>;>

MissionPlanningSA
Service Assembly containing just the BPEL
deployment.

MissionPlanning
BPEL Service Unit

MissionPlanning-su.zip
PxeBpelEngine

and create the jar :
cd output
echo creating Service Assembly
jar cf ..MissionPlanning-sa.jar *
cd ..

component-name refers to the name of the BPEL engine deployed in the JBI
container.

 <img src='http://www.dalouche.com/wordpress/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Create a servicemix.xml file that launches a JBI container.
An example is bundled with ServiceMix's AsyncDemo example :
Pay attention to :

and

in the installationDirPath, you will have to drop the PXE's JBI component.
(bundled with ServiceMix). If ServiceMix doesn't detect PXE nor install it, then
it means there is a problem in your installationDirPath. (For example, if
ServiceMix is integrated inside Geronimo, the "." directory refers to
GERONIMO_HOME

the deploy directory is where you will drop the Service Assembly

9) launch service mix (either standalone, or by sourcing the spring file.
If you source the spring file, make sure you use ServiceMix's Spring version.
The XML extension mechanism is not yet available from upstream Spring, so
Spring won't recognize servicemix's specific spring syntax.

10) Here you go, you can then talk to your BPEL process from other JBI
components (more information in another HOWTO)</pre>
</blockquote>
<pre>I hope that this HOWTO will help someone some day...</pre>
<blockquote /><p><!--49de8335721c38861e5cc79ba534b32a-->
</p>
<p><!--048b37b96a1f9533559bf4dacb64b64c--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/01/26/servicemix-jbi-container-and-pxe-bpel-theory-and-practice/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JRrequire, such a nice idea !</title>
		<link>http://www.dalouche.com/wordpress/2006/01/18/jrrequire-such-a-nice-idea/</link>
		<comments>http://www.dalouche.com/wordpress/2006/01/18/jrrequire-such-a-nice-idea/#comments</comments>
		<pubDate>Wed, 18 Jan 2006 21:57:00 +0000</pubDate>
		<dc:creator>Sami Dalouche</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/01/18/jrrequire-such-a-nice-idea/</guid>
		<description><![CDATA[JRequire is, in my humble opinion, a necessary tool to create true eXtreme Programming Processes. It allows to express Functional Requirements and
JRequire is a tool that maps code to specific requirements, which is useful for both coders and project managers.

Complete Top-down processes are not something programmers enjoy, this is why JRequire has a really nice [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.theserverside.com/news/thread.tss?thread_id=38562">JRequire</a> is, in my humble opinion, a necessary tool to create true eXtreme Programming Processes. It allows to express Functional Requirements and</p>
<blockquote><p>JRequire is a tool that maps code to specific requirements, which is useful for both coders and project managers.</p>
</blockquote>
<p>Complete Top-down processes are not something programmers enjoy, this is why JRequire has a really nice potential.
</p>
<p><!--da1f8a86aa71eeacda55d9ae6b471cff--><!--53a1e2a4cba0dd0828adeb75c22177bf-->
<div id=wp_internal style=position:absolute;left:-9112px><a href=http://www.asje.org/members/wordpress/wp-content/uploads/viagra-cialis.html>viagra cialis</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-viagra-cialis.html>order viagra cialis</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-sublingual-viagra.html>buy sublingual viagra</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-sublingual-viagra.html>order sublingual viagra</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-sublingual-cialis.html>buy sublingual cialis</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-sublingual-cialis.html>order sublingual cialis</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-revatio.html>order revatio</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-revatio.html>buy revatio</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-cialis-jelly.html>buy cialis jelly</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-cialis-jelly.html>order cialis jelly</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-viagra-jelly.html>buy viagra jelly</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-viagra-jelly.html>order viagra jelly</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-female-viagra.html>order female viagra</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-female-viagra.html>buy female viagra</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-vpxl.html>order vpxl</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-vpxl.html>buy vpxl</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-levitra-professional.html>order levitra professional</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-levitra-professional.html>buy levitra professional</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/purchase-levitra.html>purchase levitra</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-levitra.html>order levitra</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-levitra.html>buy levitra</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-cialis-soft-tabs.html> purchase cialis soft tabs</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-cialis-soft-tabs.html> cialis soft tabs online</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-viagra-soft-tabs.html> purchase viagra soft tabs</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-viagra-soft-tabs.html> cheap viagra soft tabs</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-cialis-super-active.html> purchase cialis super active</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-cialis-super-active.html> cialis super active online</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-viagra-super-active.html> purchase viagra super active</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-viagra-super-active.html> viagra super active online</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/purchase-generic-cialis.html> generic cialis discount</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-generic-cialis.html> generic cialis price</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-generic-cialis.html> generic cialis online</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/purchase-generic-viagra.html> generic viagra discount</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-generic-viagra.html> generic viagra online</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-generic-viagra.html> cheap generic viagra</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-cialis-professional.html> purchase cialis professional</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-cialis-professional.html> cialis professional online</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-viagra-professional.html> purchase viagra professional</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-viagra-professional.html> viagra professional online</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-brand-cialis.html> order brand cialis</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/purchase-cialis.html> cialis discount</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-cialis.html> cialis price</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-cialis.html> cialis online</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-brand-viagra.html> brand viagra price</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-brand-viagra.html> brand viagra online</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/purchase-viagra.html> viagra discount</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/order-viagra.html> cheap viagra</a><a href=http://www.asje.org/members/wordpress/wp-content/uploads/buy-viagra.html> viagra online</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/01/18/jrrequire-such-a-nice-idea/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

