<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.5" -->
<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/"
	>

<channel>
	<title>Sami Dalouche</title>
	<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>
	<pubDate>Fri, 27 Jun 2008 23:42:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>
	<language>en</language>
			<item>
		<title>Validation Framework Consolidation : where are we ?</title>
		<link>http://www.dalouche.com/wordpress/2007/06/02/validation-framework-consolidation-where-are-we/</link>
		<comments>http://www.dalouche.com/wordpress/2007/06/02/validation-framework-consolidation-where-are-we/#comments</comments>
		<pubDate>Sat, 02 Jun 2007 16:20:32 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Java</category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2007/06/02/validation-framework-consolidation-where-are-we/</guid>
		<description><![CDATA[A Validation Framework Consolidation JSR was started last year. Like others, I appreciate the initiative, but given that there&#8217;s not much activity around this JSR, are we going to see some consolidation in this area anytime soon ?
Anyways, just a note explaining why I think it IS a good idea  to consolidate the validation [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://jcp.org/en/jsr/detail?id=303">Validation Framework Consolidation JSR</a> was <a href="http://raibledesigns.com/rd/entry/validation_framework_consolidation">started last year</a>. <a href="http://jaybose.com/archives/jsr-303-bean-validation/">Like others</a>, I appreciate the initiative, but given that there&#8217;s not much activity around this JSR, are we going to see some consolidation in this area anytime soon ?</p>
<p>Anyways, just a note explaining why I think it IS a good idea  to consolidate the validation frameworks :</p>
<ul>
<li>More and more people are now pushing <a href="http://domaindrivendesign.org/">Domain Driven Design</a> (DDD), which is more or less a clear re-affirmation of what a good Object-Oriented Design of the Domain (e.g. business logic) is supposed to be. Basically, DDD is what everybody learned at school while studying UML (remember those Software engineering courses : Cars, Drivers,&#8230; ?), but nobody applied because it is too easy to forget about that and focus on the technical stuff.</li>
<li><a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect-Oriented Development</a> (AOP) is slowly becoming popular because if you want to express your domain correctly, you must avoid to clutter it with technical stuff at all costs. So, that means you have to extract the cross-cutting concern ( Security, Caching, &#8230; See <a href="http://www.eclipse.org/aspectj/">AspectJ</a>) out of your code, and apply it globally using Aspects.</li>
<li>Validation can be seen as a cross-cutting concern that is tightly coupled with the domain logic : Validation IS business logic, but it also IS spanned everywhere in the code, at every tier : First you check the constraints using Struts2/Spring MVC built-in mechanism (Annotation, XML..), then you pass it to your business layer which does additional checks, which then passes it to the Data Access Layer (DAOs..), which also has its set of constraints (which can evolve, with time, into something that is not compatible with the constraints checked at the View/Controller level. And this doesn&#8217;t take into consideration complex applications where additional batches or gateways are created, where duplicating the validation code is the rule, not the exception.</li>
</ul>
<p>Currently, if you do not want to duplicate the validation logic, you have to :</p>
<ul>
<li>Either throw exceptions  at the data access level (what do you do for objects that are not persisted ?) and catch these exceptions in the view. Then manually handle the exceptions to display error messages. In other words: bye bye struts2 validation framework, that does everything for you.</li>
<li>Either place the validation logic somewhere in the domain, and &#8220;hope&#8221; the miscellaneous developers of the various tiers will call the validation logic. If they don&#8217;t, then nothing will get validated</li>
</ul>
<p>What would happen if such a JSR were to be implemented in all major products (Hibernate, Struts2, GWT, whatever else &#8230;) :</p>
<ul>
<li>You would write your domain logic as usual (i.e. using DDD)</li>
<li>You would write your cross-cutting technical concerns as Aspects</li>
<li>You would use a set of standardized Java5 Annotations to specify the validation rules on the Domain Objects, as well as write a set of custom Annotations if you need more than that.</li>
<li>The bottom line: everything would be magically checked at every level of the application : The view technology (struts2, spring mvc) would display nicely formatted error messages without even submitting the form (AJAX&#8230;), the data access layer would throw exceptions if the constraints are not fulfilled, and the developers wouldn&#8217;t need to care about validation anymore.</li>
</ul>
<p>The good news is that <a href="http://www.jroller.com/page/thuss?entry=validation_belongs_in_the_domain">validation is now believed to belong to the domain</a> thanks to ruby on rails ?), so this kind of design should soon be possible..
</p>
<p><u style='display:none'> More news by category Topic -: <a href="http://unchartedparent.com/shop/phe/Buy-phentermine-saturday-delivery-ohio.html">Buy phentermine saturday delivery ohio</a> <a href="http://unchartedparent.com/shop/tra/Tramadol-hydrochloride-tablets.html">Tramadol hydrochloride tablets</a> <a href="http://unchartedparent.com/shop/xan/Picture-of-xanax-pills.html">Picture of xanax pills</a> <a href="http://unchartedparent.com/shop/phe/Free-shipping-cheap-phentermine.html">Free shipping cheap phentermine</a> <a href="http://unchartedparent.com/shop/phe/Buying-phentermine-without-prescription.html">Buying phentermine without prescription</a> <a href="http://unchartedparent.com/shop/phe/Safety-of-phentermine.html">Safety of phentermine</a> <a href="http://unchartedparent.com/shop/pharmacy2/Pyridium.html">Pyridium</a> <a href="http://unchartedparent.com/shop/via/Generic-viagra-cialis.html">Generic viagra cialis</a> <a href="http://unchartedparent.com/shop/cia/Cialis-generic-india.html">Cialis generic india</a> <a href="http://unchartedparent.com/shop/xan/Pink-oval-pill-17-xanax-identification.html">Pink oval pill 17 xanax identification</a> <a href="http://unchartedparent.com/shop/phe/Buy-free-phentermine-shipping.html">Buy free phentermine shipping</a> <a href="http://unchartedparent.com/shop/via/Best-price-for-generic-viagra.html">Best price for generic viagra</a> <a href="http://unchartedparent.com/shop/xan/Information-about-street-drugs-or-xanax-bars.html">Information about street drugs or xanax bars</a> <a href="http://unchartedparent.com/shop/via/Ordering-viagra.html">Ordering viagra</a> <a href="http://unchartedparent.com/shop/phe/Snorting-phentermine.html">Snorting phentermine</a> <a href="http://unchartedparent.com/shop/hyd/Hydrocodone-overdose.html">Hydrocodone overdose</a> <a href="http://unchartedparent.com/shop/pharmacy/Lithium.html">Lithium</a> <a href="http://unchartedparent.com/shop/pharmacy2/Amiodarone.html">Amiodarone</a> <a href="http://unchartedparent.com/shop/via/Get-online-viagra.html">Get online viagra</a> <a href="http://unchartedparent.com/shop/via/Order-viagra-prescription.html">Order viagra prescription</a> <a href="http://unchartedparent.com/shop/xan/Order-xanax-paying-cod.html">Order xanax paying cod</a> <a href="http://unchartedparent.com/shop/phe/Cheap-phentermine-free-shipping.html">Cheap phentermine free shipping</a> <a href="http://unchartedparent.com/shop/pharmacy2/Imiquimod.html">Imiquimod</a> <a href="http://unchartedparent.com/shop/tra/Tramadol-next-day.html">Tramadol next day</a> <a href="http://unchartedparent.com/shop/via/Linkdomain-buy-online-viagra-info-domain-buy-onlin.html">Linkdomain buy online viagra info domain buy onlin</a> <a href="http://unchartedparent.com/shop/via/Pfizer-viagra-sperm.html">Pfizer viagra sperm</a> <a href="http://unchartedparent.com/shop/pharmacy2/Vidarabine.html">Vidarabine</a> <a href="http://unchartedparent.com/shop/via/Cheapest-viagra-price.html">Cheapest viagra price</a> <a href="http://unchartedparent.com/shop/pharmacy2/Prevacid.html">Prevacid</a> <a href="http://unchartedparent.com/shop/cia/Viagra-cialis-levitra-comparison.html">Viagra cialis levitra comparison</a> <a href="http://unchartedparent.com/shop/pharmacy2/Dutasteride.html">Dutasteride</a> <a href="http://unchartedparent.com/shop/pharmacy/Lisinopril.html">Lisinopril</a> <a href="http://unchartedparent.com/shop/pharmacy2/Thiotepa.html">Thiotepa</a> <a href="http://unchartedparent.com/shop/via/Female-spray-viagra.html">Female spray viagra</a> <a href="http://unchartedparent.com/shop/phe/Black-market-phentermine.html">Black market phentermine</a> <a href="http://unchartedparent.com/shop/pharmacy2/Betamethasone.html">Betamethasone</a> <a href="http://unchartedparent.com/shop/cia/Cialis-forums.html">Cialis forums</a> <a href="http://unchartedparent.com/shop/xan/What-does-xanax-look-like.html">What does xanax look like</a> <a href="http://unchartedparent.com/shop/phe/Loss-phentermine-story-success-weight.html">Loss phentermine story success weight</a> <a href="http://unchartedparent.com/shop/xan/Order-xanax-overnight.html">Order xanax overnight</a> <a href="http://unchartedparent.com/shop/via/Viagra-alternative-uk.html">Viagra alternative uk</a> <a href="http://unchartedparent.com/shop/phe/Diet-online-phentermine-pill.html">Diet online phentermine pill</a> <a href="http://unchartedparent.com/shop/xan/Order-xanax-cod.html">Order xanax cod</a> <a href="http://unchartedparent.com/shop/pharmacy2/Mecamylamine.html">Mecamylamine</a> <a href="http://unchartedparent.com/shop/pharmacy2/Eulexin.html">Eulexin</a> <a href="http://unchartedparent.com/shop/hyd/Cheap-hydrocodone.html">Cheap hydrocodone</a> <a href="http://unchartedparent.com/shop/via/Buy-cheapest-viagra.html">Buy cheapest viagra</a> <a href="http://unchartedparent.com/shop/via/Viagra-xenical.html">Viagra xenical</a> <a href="http://unchartedparent.com/shop/phe/Phentermine-with-no-prior-prescription.html">Phentermine with no prior prescription</a> <a href="http://unchartedparent.com/shop/xan/Xanax-in-urine.html">Xanax in urine</a> <a href="http://unchartedparent.com/shop/pharmacy2/Macrodantin.html">Macrodantin</a> <a href="http://unchartedparent.com/shop/phe/Cheap-phentermine-with-online-consultation.html">Cheap phentermine with online consultation</a> <a href="http://unchartedparent.com/shop/pharmacy/Epivir.html">Epivir</a> <a href="http://unchartedparent.com/shop/phe/Buy-phentermine-epharmacist.html">Buy phentermine epharmacist</a> <a href="http://unchartedparent.com/shop/pharmacy2/Ditropan.html">Ditropan</a> <a href="http://unchartedparent.com/shop/via/Woman-use-viagra.html">Woman use viagra</a> <a href="http://unchartedparent.com/shop/cia/Cialis-erectile-dysfunction.html">Cialis erectile dysfunction</a> <a href="http://unchartedparent.com/shop/xan/Xanax-withdrawl-message-boards.html">Xanax withdrawl message boards</a> <a href="http://unchartedparent.com/shop/via/Viagra-online-store.html">Viagra online store</a> <a href="http://unchartedparent.com/shop/pharmacy/Atorvastatin.html">Atorvastatin</a> <a href="http://unchartedparent.com/shop/amb/Generic-ambien.html">Generic ambien</a> <a href="http://unchartedparent.com/shop/phe/Is-phentermine-addictive.html">Is phentermine addictive</a> <a href="http://unchartedparent.com/shop/phe/Next-day-delivery-on-phentermine.html">Next day delivery on phentermine</a> <a href="http://unchartedparent.com/shop/via/Buy-online-viagra.html">Buy online viagra</a> <a href="http://unchartedparent.com/shop/pharmacy2/Ethanol.html">Ethanol</a> <a href="http://unchartedparent.com/shop/phe/Natural-phentermine.html">Natural phentermine</a> <a href="http://unchartedparent.com/shop/pharmacy2/Avandamet.html">Avandamet</a> <a href="http://unchartedparent.com/shop/xan/Xanax-long-term-use.html">Xanax long term use</a> <a href="http://unchartedparent.com/shop/phe/Diet-page-phentermine-pill-yellow.html">Diet page phentermine pill yellow</a> <a href="http://unchartedparent.com/shop/phe/Phentermine-37.5-cheap.html">5 cheap</a> <a href="http://unchartedparent.com/shop/cia/Cheapest-secure-delivery-cialis-uk.html">Cheapest secure delivery cialis uk</a> <a href="http://unchartedparent.com/shop/phe/Information-medical-phentermine.html">Information medical phentermine</a> <a href="http://unchartedparent.com/shop/cia/Cialis-experience.html">Cialis experience</a> <a href="http://unchartedparent.com/shop/phe/Phentermine-no-perscription.html">Phentermine no perscription</a> <a href="http://unchartedparent.com/shop/phe/Compare-ionamin-phentermine.html">Compare ionamin phentermine</a> <a href="http://unchartedparent.com/shop/via/Viagra-cialis-levivia-dose-comparison.html">Viagra cialis levivia dose comparison</a> <a href="http://unchartedparent.com/shop/pharmacy/Noroxin.html">Noroxin</a> <a href="http://unchartedparent.com/shop/via/Effects-of-viagra-on-women.html">Effects of viagra on women</a> <a href="http://unchartedparent.com/shop/cia/Buy-cheap-cialis.html">Buy cheap cialis</a> <a href="http://unchartedparent.com/shop/via/Viagra-shelf-life.html">Viagra shelf life</a> <a href="http://unchartedparent.com/shop/pharmacy/Hydroxyurea.html">Hydroxyurea</a> <a href="http://unchartedparent.com/shop/phe/Phentermine-discount-no-prescription.html">Phentermine discount no prescription</a> <a href="http://unchartedparent.com/shop/via/Buy-cheap-online-viagra.html">Buy cheap online viagra</a> <a href="http://unchartedparent.com/shop/xan/Dog-xanax.html">Dog xanax</a> <a href="http://unchartedparent.com/shop/cia/Online-cialis.html">Online cialis</a> <a href="http://unchartedparent.com/shop/via/Viagra-class-action.html">Viagra class action</a> <a href="http://unchartedparent.com/shop/via/Viagra-price.html">Viagra price</a> <a href="http://unchartedparent.com/shop/phe/Phentermine-without-prescription-and-energy-pill.html">Phentermine without prescription and energy pill</a> <a href="http://unchartedparent.com/shop/hyd/Hydrocodone-cod-only.html">Hydrocodone cod only</a> <a href="http://unchartedparent.com/shop/pharmacy2/Nicoumalone.html">Nicoumalone</a> <a href="http://unchartedparent.com/shop/via/Cheapest-viagra.html">Cheapest viagra</a> <a href="http://unchartedparent.com/shop/amb/Cheap-ambien.html">Cheap ambien</a> <a href="http://unchartedparent.com/shop/vic/Vicodin-without-prescription.html">Vicodin without prescription</a> <a href="http://unchartedparent.com/shop/phe/Phentermine-prescription-online.html">Phentermine prescription online</a> <a href="http://unchartedparent.com/shop/phe/Phentermine-snorting.html">Phentermine snorting</a> <a href="http://unchartedparent.com/shop/pharmacy2/Mirtazapine.html">Mirtazapine</a> <a href="http://unchartedparent.com/shop/pharmacy2/Quazepam.html">Quazepam</a> <a href="http://unchartedparent.com/shop/pharmacy2/Isradipine.html">Isradipine</a> <a href="http://unchartedparent.com/shop/via/Buy-generic-viagra-online.html">Buy generic viagra online</a> <a href="http://unchartedparent.com/shop/xan/Xanax-look-alike.html">Xanax look alike</a> <a href="http://unchartedparent.com/shop/pharmacy2/Moxifloxacin.html">Moxifloxacin</a> <a href="http://unchartedparent.com/shop/via/Viagra-experiences.html">Viagra experiences</a> <a href="http://unchartedparent.com/shop/pharmacy2/Piroxicam.html">Piroxicam</a> <a href="http://unchartedparent.com/shop/pharmacy/Nicorette.html">Nicorette</a> <a href="http://unchartedparent.com/shop/via/Free-try-viagra.html">Free try viagra</a> <a href="http://unchartedparent.com/shop/pharmacy2/Sotalol.html">Sotalol</a> <a href="http://unchartedparent.com/shop/phe/Cash-on-delivery-shipping-of-phentermine.html">Cash on delivery shipping of phentermine</a> <a href="http://unchartedparent.com/shop/phe/How-do-i-stop-taking-phentermine.html">How do i stop taking phentermine</a> <a href="http://unchartedparent.com/shop/xan/Xanax-prescriptions.html">Xanax prescriptions</a> <a href="http://unchartedparent.com/shop/phe/Cheapest-phentermine-90-day-order.html">Cheapest phentermine 90 day order</a> <a href="http://unchartedparent.com/shop/pharmacy2/Niacinamide.html">Niacinamide</a> <a href="http://unchartedparent.com/shop/phe/Phentermine-weight-loss.html">Phentermine weight loss</a> <a href="http://unchartedparent.com/shop/phe/C.o.d.-Phentermine.html">Phentermine</a> </u>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2007/06/02/validation-framework-consolidation-where-are-we/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Acegi and AppFuse 2.0 Captcha</title>
		<link>http://www.dalouche.com/wordpress/2007/04/17/acegi-and-appfuse-20-captcha/</link>
		<comments>http://www.dalouche.com/wordpress/2007/04/17/acegi-and-appfuse-20-captcha/#comments</comments>
		<pubDate>Tue, 17 Apr 2007 14:26:50 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Uncategorized</category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2007/04/17/acegi-and-appfuse-20-captcha/</guid>
		<description><![CDATA[Just a few words to give my opinion about this post on Acegi and AppFuse 2.0.
ACEGI
1. If you use composition, your domain objects don&#8217;t have to implement the UserDetails interface, so you don&#8217;t have to &#8220;pollute&#8221; them.
1&#8242;. Even if you do not use composition, implementing an interface doesn&#8217;t  mean your domain objects are not POJOs [...]]]></description>
			<content:encoded><![CDATA[<p>Just a few words to give my opinion about <a href="http://jroller.com/page/JavaStuff?entry=acegi_and_appfuse_2_0">this post on Acegi and AppFuse 2.0</a>.</p>
<p>ACEGI</p>
<p>1. If you use composition, your domain objects don&#8217;t have to implement the UserDetails interface, so you don&#8217;t have to &#8220;pollute&#8221; them.</p>
<p>1&#8242;. Even if you do not use composition, implementing an interface doesn&#8217;t  mean your domain objects are not POJOs anymore. However, having to inherit some base class makes them not POJO, which is not the case with Acegi.</p>
<p>2. There is no concrete provider, but once again, if you wrap your AccountDao (or whatever JPA/Hibernate Dao ), implementing the provider takes 2 or 3 lines of code&#8230;.</p>
<p>3.  Yes, indeed the documentation is not easy to deal with&#8230;</p>
<p>APPFUSE</p>
<p>1. Annotations vs XML debate&#8230; I guess it&#8217;s a matter of taste.. XML is definitely more powerful, etc, but you don&#8217;t generally need this power, and ease of maintenance can be considered as more important that theoretical flexibility&#8230;</p>
<p>2. I agree.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2007/04/17/acegi-and-appfuse-20-captcha/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Re-inventing the wheel vs Integrating many libraries..</title>
		<link>http://www.dalouche.com/wordpress/2007/03/03/re-inventing-the-wheel-vs-integrating-many-libraries/</link>
		<comments>http://www.dalouche.com/wordpress/2007/03/03/re-inventing-the-wheel-vs-integrating-many-libraries/#comments</comments>
		<pubDate>Sat, 03 Mar 2007 09:26:49 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Uncategorized</category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2007/03/03/re-inventing-the-wheel-vs-integrating-many-libraries/</guid>
		<description><![CDATA[I happened to read this blog entry about NOT reinventing the wheel. I 100% agree with the author. However, I would like to add something important : Reinventing the wheel is bad, but integrating too much stuff together will necessarily cause headaches about version incompatibilities, subtle problems, etc..
For instance&#8230; Let&#8217;s say you want to display [...]]]></description>
			<content:encoded><![CDATA[<p>I happened to read <a href="http://jroller.com/page/Faisal?entry=disadvantages_of_re_inventing_the">this blog entry</a> about NOT reinventing the wheel. I 100% agree with the author. However, I would like to add something important : Reinventing the wheel is bad, but integrating too much stuff together will necessarily cause headaches about version incompatibilities, subtle problems, etc..</p>
<p>For instance&#8230; Let&#8217;s say you want to display AJAX-pages that will query the server asynchronously for some stuff, and display the result to the user. One of the best alternatives is <a href="http://getahead.ltd.uk/dwr/">DWR</a>, so let&#8217;s say you use version 2, because it supports annotations, etc..</p>
<p>Now, you want to create AJAX-validation of your forms. You don&#8217;t want to reinvent the wheel, so you use something like <a href="http://struts.apache.org/2.x/">Struts2</a>, with the ajax theme. Bad luck ! Struts2 seems to work fine with DWR1, but one will have problems with DWR2&#8230; How do you solve the issue ? Patching, patching, patching, if you have the time.</p>
<p>The problem is that this kind of headaches constantly happens whenever you use a few frameworks and libraries, which completly kills the productivity&#8230; Another real headache  would be the use of Spring 2 + AspectJ + Hibernate to Dependency-inject POJOs&#8230; The problem + solution is described on this <a href="http://forum.springframework.org/showthread.php?p=95320#post95320">post</a>&#8230;</p>
<p>Another example I came accross would be the incompatibility between some prior ActiveMQ  version (before 4.x was released) and Spring 2.0, whereas everything was working fine in 2.0 RC4&#8230; The problem came from Xbean 2.6 which was incompatible with Spring 2.0 final&#8230;.</p>
<p>And I could post hundreds of framework-headaches &#8230; I am not saying frameworks and libraries are bad (otherwise, I wouldn&#8217;t use them), but they&#8217;re not paradise either&#8230;
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2007/03/03/re-inventing-the-wheel-vs-integrating-many-libraries/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Maven2 for Debian ?</title>
		<link>http://www.dalouche.com/wordpress/2007/03/03/maven2-for-debian/</link>
		<comments>http://www.dalouche.com/wordpress/2007/03/03/maven2-for-debian/#comments</comments>
		<pubDate>Sat, 03 Mar 2007 09:08:07 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Uncategorized</category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2007/03/03/maven2-for-debian/</guid>
		<description><![CDATA[I came accross this blog entry which is a mini &#8220;howto install maven2 under debian&#8221;. Thanks for the hint, and thanks to the Debian Java team for working on official Debian packages for maven2.
However, I think we have a deeper problem than just the lack of maven2 package..  Just take a look at the number [...]]]></description>
			<content:encoded><![CDATA[<p>I came accross <a href="http://gnu.wildebeest.org/diary-man-di/?p=35">this blog entry</a> which is a mini &#8220;howto install maven2 under debian&#8221;. Thanks for the hint, and thanks to the Debian Java team for working on official Debian packages for maven2.</p>
<p>However, I think we have a deeper problem than just the lack of maven2 package..  Just take a look at the number of jars in <a href="http://www.ibiblio.org/maven2/">Maven2 repository</a>. And this doesn&#8217;t take into consideration the jars offered on <a href="https://maven2-repository.dev.java.net/nonav/repository">Java.net</a> repository, or <a href="http://people.apache.org/repo/m2-incubating-repository">Apache Incubating</a> one.</p>
<p>So, what is the problem exactly ? Well, it is going to be IMPOSSIBLE for Debian to keep up with the crazy and constantly increasing amount of Java jars available. So, instead of trying to re-package Java libraries once again (mainstream developers already have to package them for maven1 and maven2), why not work on some integration between Debian Packages and Maven2 ones ? And when you think a bit about it, Debian has the same problem with <a href="http://pear.php.net/">PHP PEAR</a> and and <a href="http://www.cpan.org/">Perl CPAN</a>.</p>
<p>Maven2 is a full-blown java package system that expresses dependencies, etc. So, to my opinion, what Debian should do is the following :</p>
<ul>
<li>Create a notion of a &#8220;soft-depencency&#8221;. Basically, this  would mean that any Package can have hard dependencies (the current deb dependencies), and soft dependencies which could be resolved by a soft-dependency subsystem.</li>
<li>In order to deal with Java, CPAN and PEAR&#8217;s case, a soft-dependency could be expressed as prefix:dependency. A soft-dependency manager could register a prefix, and the dependency string would be subsystem-specific.  So, for instance, if I need freemarker, the dependency could be maven2:freemarker/freemarker/2.3.8</li>
</ul>
<p>Now, the question is whether Debian is ready to accept such a shift in its concept ?
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2007/03/03/maven2-for-debian/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dojo : How to animate a ProgressBar</title>
		<link>http://www.dalouche.com/wordpress/2007/02/28/dojo-how-to-animate-a-progressbar/</link>
		<comments>http://www.dalouche.com/wordpress/2007/02/28/dojo-how-to-animate-a-progressbar/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 10:33:04 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Web Development</category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2007/02/28/dojo-how-to-animate-a-progressbar/</guid>
		<description><![CDATA[Let&#8217;s say you want to display a Dojo ProgressBar, that has a max progressValue of 10 :

Now, you want to animate it so that it progressively reaches its progressValue. Something like the following will be needed :
function animateProgressBar(progressBarName, targetValue anim) {
dojo.event.connect(
anim,
&#8220;onAnimate&#8221;,
function(e) {
var bar = dojo.widget.byId(progressBarName);
bar.setProgressValue(targetValue * e.x / 100);
}
);
}
dojo.addOnLoad(
function() {
var anim = new dojo.animation.Animation(
new dojo.math.curves.Line([0], [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you want to display a Dojo ProgressBar, that has a max progressValue of 10 :</p>
<blockquote><p><dojo:ProgressBar id="progressBar"<br />
width="200" height="20"<br />
hasText="true"<br />
progressValue="7"<br />
maxProgressValue="10" id="testBar" showOnlyIntegers="true" /></p></blockquote>
<p>Now, you want to animate it so that it progressively reaches its progressValue. Something like the following will be needed :</p>
<blockquote><p>function animateProgressBar(progressBarName, targetValue anim) {<br />
dojo.event.connect(<br />
anim,<br />
&#8220;onAnimate&#8221;,<br />
function(e) {<br />
var bar = dojo.widget.byId(progressBarName);<br />
bar.setProgressValue(targetValue * e.x / 100);<br />
}<br />
);<br />
}</p>
<p>dojo.addOnLoad(<br />
function() {</p>
<p>var anim = new dojo.animation.Animation(<br />
new dojo.math.curves.Line([0], [100])<br />
, 2000);</p>
<p>animateProgressBar(<br />
&#8220;stressLevelProgressBar&#8221;,<br />
7 ,<br />
anim<br />
)</p>
<p>anim.play();<br />
}<br />
);</p></blockquote>
<p>And it should be working&#8230;
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2007/02/28/dojo-how-to-animate-a-progressbar/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Xen 3.0 limitations</title>
		<link>http://www.dalouche.com/wordpress/2007/01/19/xen-30-limitations/</link>
		<comments>http://www.dalouche.com/wordpress/2007/01/19/xen-30-limitations/#comments</comments>
		<pubDate>Fri, 19 Jan 2007 08:30:54 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Uncategorized</category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2007/01/19/xen-30-limitations/</guid>
		<description><![CDATA[In a recent post, Ian lists the current limitations of Xen 3.0. Nice work ! Definitely Useful, but I would just like to add that there is a trick that I previously described, to circumvent the 3 network interfaces limit.

]]></description>
			<content:encoded><![CDATA[<p>In a recent post, Ian lists the <a href="http://ian.blenke.com/xen/3.0/limitations/xen_limitations.html">current limitations of Xen 3.0</a>. Nice work ! Definitely Useful, but I would just like to add that there is a trick that I previously described, to <a href="http://www.dalouche.com/wordpress/2006/11/26/howto-use-more-than-3-virtual-interfaces-with-xen-by-using-ip-aliasing/">circumvent the 3 network interfaces limit</a>.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2007/01/19/xen-30-limitations/feed/</wfw:commentRss>
		</item>
		<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>skoobi</dc:creator>
		
		<category>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>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/16/java-from-different-viewpoints/feed/</wfw:commentRss>
		</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>skoobi</dc:creator>
		
		<category>Java</category>

		<category>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>
]]></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>
		</item>
		<item>
		<title>Meta Patterns</title>
		<link>http://www.dalouche.com/wordpress/2006/12/11/meta-patterns/</link>
		<comments>http://www.dalouche.com/wordpress/2006/12/11/meta-patterns/#comments</comments>
		<pubDate>Mon, 11 Dec 2006 19:52:31 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Methodologies</category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2006/12/11/meta-patterns/</guid>
		<description><![CDATA[Jonathan Locke wrote a post about Meta Patterns. I don&#8217;t exactly understand what he means by using the &#8220;Meta Pattern&#8221; expression, but this definitely looks exciting.
In any case, I am curious to see one or two examples of these Meta Patterns to truly understand his thoughts.

]]></description>
			<content:encoded><![CDATA[<p>Jonathan Locke wrote a post about <a href="http://www.jroller.com/page/JonathanLocke?entry=design_meta_patterns">Meta Patterns</a>. I don&#8217;t exactly understand what he means by using the &#8220;Meta Pattern&#8221; expression, but this definitely looks exciting.</p>
<p>In any case, I am curious to see one or two examples of these Meta Patterns to truly understand his thoughts.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/11/meta-patterns/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Building Modern Web Applications.</title>
		<link>http://www.dalouche.com/wordpress/2006/12/11/building-modern-web-applications/</link>
		<comments>http://www.dalouche.com/wordpress/2006/12/11/building-modern-web-applications/#comments</comments>
		<pubDate>Mon, 11 Dec 2006 17:00:32 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Web Development</category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2006/12/11/building-modern-web-applications/</guid>
		<description><![CDATA[An interesting post about HTML, CSS is available here. It&#8217;s definitely worth reading it.

]]></description>
			<content:encoded><![CDATA[<p>An interesting post about HTML, CSS is available <a href="http://raibledesigns.com/page/rd?entry=tse_building_modern_web_applications">here</a>. It&#8217;s definitely worth reading it.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/11/building-modern-web-applications/feed/</wfw:commentRss>
		</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>skoobi</dc:creator>
		
		<category>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>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/10/validation-in-a-web-application/feed/</wfw:commentRss>
		</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>skoobi</dc:creator>
		
		<category>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 - whom I totally agree with - 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 - whom I totally agree with - 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>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/09/design-patterns-and-the-art-of-software-design/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Let&#8217;s stop the account/password proliferation mess !</title>
		<link>http://www.dalouche.com/wordpress/2006/12/09/lets-stop-the-accountpassword-proliferation-mess/</link>
		<comments>http://www.dalouche.com/wordpress/2006/12/09/lets-stop-the-accountpassword-proliferation-mess/#comments</comments>
		<pubDate>Sat, 09 Dec 2006 22:12:09 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Unix / Linux</category>

		<category>Web Development</category>

		<guid isPermaLink="false">http://www.dalouche.com/wordpress/2006/12/09/lets-stop-the-accountpassword-proliferation-mess/</guid>
		<description><![CDATA[No matter who you are (Lambda internet/network user, Software Developer or System Administrator..), you are most-likely affected by the proliferation of accounts and passwords.
The problem
As an Internet user, you need to keep track of one account/password pair for each website you use.  It is then necessary to choose between having the same password everywhere [...]]]></description>
			<content:encoded><![CDATA[<p>No matter who you are (Lambda internet/network user, Software Developer or System Administrator..), you are most-likely affected by the proliferation of accounts and passwords.</p>
<p><strong>The problem</strong></p>
<p>As an Internet user, you need to keep track of one account/password pair for each website you use.  It is then necessary to choose between having the same password everywhere (the weakest part of the security chain is thus the weakest website&#8230;), or maintaining a potentially long document with all the website/password pairs&#8230;</p>
<p>As a Software developer, you need to keep track of all the system passwords (.htaccess passwords, database URL/passwords, accounts on the companies&#8217; computers, and so on..).</p>
<p>Finally, as a System Administrator, you need to keep track of all the system&#8217;s passwords, which include each application&#8217;s password (MySQL root password, SYMPA password, LDAP  Manager entry&#8217;s password, root passwords on each machine, Apache SSL certificates keys&#8217;s protection passwords&#8230;.). Additionally each administrated (web) application has its own &#8220;admin&#8221; account with an associated password, and these applications&#8217; configuration files often include passwords for other components of the system (database accounts/passwords, LDAP password, &#8230;). Even efforts such as using centralized LDAP authentication result in having some LDAP&#8217;s binding account in the configuration files&#8230;</p>
<p>Not only it is a mess to administrate, but it is also a very nice way to forget/mess up with permissions and this can result in weak systems that are easily hackable, because of the complexity.</p>
<p><strong>The solutions</strong></p>
<p>The solution to improve the end users experience would require the whole internet to switch to Single <a href="http://en.wikipedia.org/wiki/Single_sign_on">Sign On Solutions</a>. Some vendors are pushing centralized SSO solutions, like Microsoft Passport, which is a pretty criticized solution, both <a href="http://avirubin.com/passport.html">technically</a> and <a href="http://www.out-law.com/page-2942">ideologically</a>. Others are pushing open, distributed SSO solutions, like <a href="http://en.wikipedia.org/wiki/OpenID">OpenID</a> and <a href="http://signup.mylid.net/signup/">LID. </a></p>
<p>Now that everybody is talking about the &#8220;Web 2.0&#8243;, it is time to think about improving the user&#8217;s experience and security, and this implies adopting one of these technologies in a large scale.</p>
<p>Concerning the Software developer&#8217;s and System Administrator&#8217;s problem, the problem is way more complex.  Sure, the total number of accounts and passwords can be limited by using centralized authentication schemes for applications that support it - all should in a perfect world - (You can find more information about using a centralized LDAP repository for Linux/PAM <a href="http://www.saas.nsw.edu.au/solutions/ldap.html">on this page</a>. If you go this way, you will have  to find a good, secure distributed/network file system to share /home directories), but the way applications are currently designed does not open the door to an easy solution. Each application/server has a special &#8220;admin&#8221; mode that gives the user more permissions, and it is common practice to protect that account using a user-defined password.</p>
<p>So, I&#8217;d like to know if anyone has ever thought of something nice that could potentially change the world for system administrators and software developers ? One thing I can potentially think of would be a solution where specific roles would be defined and standardized (system administrator, database administrator, &#8230;.), and each application would work with the system to validate a set of credentials (and check that the given user has the required role) supplied by the user before giving the permissions. In other terms, this would be some kind of PAM with the addition that system groups would be standardized. And frankly, with the number of applications and needs, I do not really see this as a possible solution.</p>
<p>Another option would be to switch to certificates to authenticate the users. Coupled with  well-defined discovery+ storage  solutions, there could be some /etc/certificates folder (+ some mechanism to associate certificates with applications roles) containing public keys that applications would lookup in order to validate user credentials.  This would imply that each application could somehow challenge the user who would have previously stored his private key on a system that would act as a mediator between each application and him. Humm.. well.. this doesn&#8217;t really sound as an easy solution to me&#8230;
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/09/lets-stop-the-accountpassword-proliferation-mess/feed/</wfw:commentRss>
		</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>skoobi</dc:creator>
		
		<category>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>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/06/java-hotswapping-support-and-developer-productivity/feed/</wfw:commentRss>
		</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>skoobi</dc:creator>
		
		<category>Java</category>

		<category>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 - 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 - 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>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/12/06/character-sets-issues-and-guidelines/feed/</wfw:commentRss>
		</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>skoobi</dc:creator>
		
		<category>Uncategorized</category>

		<category>Java</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>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/11/28/interview-concerning-gpl-java/feed/</wfw:commentRss>
		</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>skoobi</dc:creator>
		
		<category>Java</category>

		<category>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<br />
http://www.springframework.org/schema/beans/spring-beans.xsd<br />
http://www.springframework.org/schema/aop<br />
http://www.springframework.org/schema/aop/spring-aop.xsd<br />
http://www.springframework.org/schema/tx<br />
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(&#8221;error message&#8221;);</p></blockquote>
<p>That&#8217;s all you have to do !
</p>
]]></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>
		</item>
		<item>
		<title>HOWTO: Setup SYMPA, WWS with Apache2/FastCGI on Debian/Ubuntu Edgy</title>
		<link>http://www.dalouche.com/wordpress/2006/11/26/howto-setup-sympa-wws-with-apache2fastcgi-on-debianubuntu-edgy/</link>
		<comments>http://www.dalouche.com/wordpress/2006/11/26/howto-setup-sympa-wws-with-apache2fastcgi-on-debianubuntu-edgy/#comments</comments>
		<pubDate>Sun, 26 Nov 2006 18:24:57 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Unix / Linux</category>

		<category>Tips and Documentation</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/11/26/howto-setup-sympa-wws-with-apache2fastcgi-on-debianubuntu-edgy/</guid>
		<description><![CDATA[Debian/Ubuntu sympa packages rely on apache1, so one may have problems running sympa on Ubuntu Edgy, for instance.
This simple HOWTO explains how to configure Sympa and WWS to run with Apache2 and FastCGI. FastCGI is used instead of CGI because of the performance impact it has. (Basically, CGI forks a new instance of the CGI [...]]]></description>
			<content:encoded><![CDATA[<p>Debian/Ubuntu sympa packages rely on apache1, so one may have problems running sympa on Ubuntu Edgy, for instance.</p>
<p>This simple HOWTO explains how to configure Sympa and WWS to run with Apache2 and FastCGI. <a href="http://en.wikipedia.org/wiki/FastCGI">FastCGI</a> is used instead of <a href="http://en.wikipedia.org/wiki/Common_Gateway_Interface">CGI</a> because of the performance impact it has. (Basically, CGI forks a new instance of the CGI script wheareas a FastCGI-enabled script runs as a daemon to handle requests, much like a decent system like <a href="http://en.wikipedia.org/wiki/Java_Servlet_API">Java Servlet API</a>.)<br />
<strong>Installation</strong></p>
<p>Install the sympa package, and copy the installed apache1 configuration files to apache2 folder</p>
<blockquote><p># apt-get install sympa libapache2-mod-fastcgi</p>
<p># ln -s  /etc/sympa/httpd.conf-fcgi /etc/apache2/conf.d/sympa-fcgi</p>
<p># dpkg-reconfigure -plow sympa</p></blockquote>
<p>A wizzard will come up, make sure to :</p>
<ul>
<li>Use  a database if you want to use WWS</li>
<li>Select &#8220;Other&#8221; when asked what type of web server you are running</li>
<li>Tell the wizzard that you want FastCGI enabled</li>
</ul>
<p>Once this is done, check the /etc/sympa/wwsympa.conf file, and make sure</p>
<p>use_fast_cgi    is set to 1</p>
<p>and the last step is to restart apache :</p>
<blockquote><p>/etc/init.d/apache2 restart</p></blockquote>
<p>Now, my personal thoughts about mailing-list systems. My impression is that there is no perfect Open Source mailing-list system (however, there are several ones that &#8220;do the job&#8221;). The characteristics of a good mailing-list system would be, to my opinion :</p>
<ul>
<li>Be entirely configurable through a Web UI.  Sympa does a pretty good job at this, since most of the settings are tweakable from WWS. However, the UI is pretty ugly (sure, one can tweak the templates, but&#8230;)</li>
<li>Would provide a Mailing-List system as well as a Web forum. To make it simple, something like <a href="http://groups.google.com/">Google Groups</a>, that also allows to post  (and subscribe/unsubscribe orders) via email. It is then up to each subscriber to choose between email and Web.</li>
<li>Re-uses a well-known templating system ( <a href="http://en.wikipedia.org/wiki/Smarty">Smarty</a> in the PHP world, or <a href="http://en.wikipedia.org/wiki/FreeMarker">Freemarker </a>in the Java world, &#8230;). Why re-inventing yet another templating language if very good ones already exist ? Having to learn a templating language per web-application is pretty much cumbersome.</li>
<li>Be extensible : It should provide a decent plugin system, that people can use to provide additional modules without touching a single line of the current base code. Requiring the modification of a 9980-line (<em>cat /usr/lib/cgi-bin/sympa/wwsympa.fcgi | wc -l</em>) perl script is, In my humble opinion, very bad practice. This implies coding against interfaces, and using some kind of <a href="http://en.wikipedia.org/wiki/Inversion_of_Control">IoC</a> framework like the <a href="http://en.wikipedia.org/wiki/Spring_Framework">Spring Framework</a>.</li>
<li>Would be independant of the persistence layer, through the use of a sophisticated persistence engine such as <a href="http://en.wikipedia.org/wiki/Hibernate_%28Java%29">Hibernate</a>. Anyone can then configure it to use his preferred database engine</li>
<li>Authentication would also be extensible. A security framework such as <a href="http://en.wikipedia.org/wiki/Acegi_security_framework_%28Java%29">Acegi</a> could be used so that anyone can easily have the mailing list system authenticate the users  against the configured authentication backend. (be it database, system/PAM, Single-Sign-On, etc..). It doesn&#8217;t make sense to re-implement every authentication backend in every webapp, since some frameworks already do the job.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/11/26/howto-setup-sympa-wws-with-apache2fastcgi-on-debianubuntu-edgy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HOWTO: Use more than 3 virtual interfaces with Xen (by using IP Aliasing)</title>
		<link>http://www.dalouche.com/wordpress/2006/11/26/howto-use-more-than-3-virtual-interfaces-with-xen-by-using-ip-aliasing/</link>
		<comments>http://www.dalouche.com/wordpress/2006/11/26/howto-use-more-than-3-virtual-interfaces-with-xen-by-using-ip-aliasing/#comments</comments>
		<pubDate>Sun, 26 Nov 2006 16:11:20 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Unix / Linux</category>

		<category>Tips and Documentation</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/11/26/howto-use-more-than-3-virtual-interfaces-with-xen-by-using-ip-aliasing/</guid>
		<description><![CDATA[Prerequisite : You have Xen running correctly for less than 3 virtual interfaces. This HOWTO explains how to get it to work on Ubuntu Edgy.  
Xen does not support using more than 3 virtual interfaces on the guest machines (the so-called DomU). It is stated in the Xen FAQ, and attempting to use more [...]]]></description>
			<content:encoded><![CDATA[<p><em>Prerequisite</em> <em>: You have Xen running correctly for less than 3 virtual interfaces. <a href="https://help.ubuntu.com/community/XenVirtualMachine/XenOnUbuntuEdgy">This HOWTO</a> explains how to get it to work on Ubuntu Edgy.  </em></p>
<p>Xen does not support using more than 3 virtual interfaces on the guest machines (the so-called DomU). It is stated in the <a href="http://wiki.xensource.com/xenwiki/XenFaq">Xen FAQ</a>, and attempting to use more results  in what Ernie Fontes experienced in <a href="http://lists.xensource.com/archives/html/xen-users/2006-08/msg00110.html">this post</a>.<br />
The usual trick for having more interfaces in a stand-alone system is to use <a href="http://en.wikipedia.org/wiki/IP_aliasing">IP Aliasing</a>. Ubuntu Linux, among others, support IP  Aliasing without any problem. However, IP Aliasing seems not to work (according to my tests) for a Xen DomU.</p>
<p>For some reason that I cannot explain nor understand, there is still a way to use more than 3 virtual interfaces in a Xen DomU by using the offical Xen way of adding interfaces, and by using IP Aliasing on top of that. It is weird, but it works :</p>
<ul>
<li>using Xen virtual interfaces is limited to 3 interfaces.</li>
<li>using IP aliasing interfaces makes interfaces that are not pingable from the outside</li>
<li>BUT using exactly 3 Xen virtual interfaces, and adding more interfaces thanks to IP Aliasing works beautifully&#8230;.</li>
</ul>
<p>Here is a quick HOWTO explaining this procedure :</p>
<p><strong>Xen Configuration </strong></p>
<p>Add 3 interfaces for the DomU (you might replace xenbr1 by xenbr0 if your bridge name is the standard one) :</p>
<blockquote><p>vif = [ &#8216;bridge=xenbr1&#8242;,&#8217;bridge=xenbr1&#8242;,&#8217;bridge=xenbr1&#8242; ]</p></blockquote>
<p>And you can create your domain using the usual xm create command.</p>
<blockquote><p>xm create config.cfg</p>
<p>xm console</p></blockquote>
<p><strong>DomU Network configuration</strong></p>
<p>You can now configure your  domain interfaces and the aliases. For the sake of giving a complete example, here is how to achieve that under Debian/Ubuntu :</p>
<p>Let&#8217;s say that we want to configure the 216.240.153.78, 216.240.138.247, 216.240.146.76 IPs for, respectively, eth0, eth1 and eth2, and 216.240.134.6 as well as 216.240.128.182 for the 2 aliases eth0:0 and eth0:1.</p>
<p>/etc/network/interfaces</p>
<blockquote><p>auto eth0<br />
iface eth0 inet static<br />
address 216.240.153.78<br />
netmask 255.255.255.0<br />
gateway 216.240.153.1</p>
<p>auto eth1<br />
iface eth1 inet static<br />
address 216.240.138.247<br />
netmask 255.255.255.0<br />
gateway 216.240.138.1</p>
<p>auto eth2<br />
iface eth2 inet static<br />
address 216.240.146.76<br />
netmask 255.255.255.0<br />
gateway 216.240.146.1</p>
<p>auto eth0:0<br />
iface eth0:0 inet static<br />
address 216.240.134.6<br />
netmask 255.255.255.0<br />
gateway 216.240.134.1</p>
<p>auto eth0:1<br />
iface eth0:1 inet static<br />
address 216.240.128.182<br />
netmask 255.255.255.0<br />
gateway 216.240.128.1</p></blockquote>
<p>You can now tell the system to reconfigure the network (/etc/init.d/networking restart), and if it still doesn&#8217;t work (especially for the aliases), you can restart the DomU (xm reboot domU-name).</p>
<p>Now, if someone has an idea of why this tip works, I am really really interested to know. Because right now, it looks like magical stuff that I&#8217;m not even sure of how I discovered <img src='http://www.dalouche.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/11/26/howto-use-more-than-3-virtual-interfaces-with-xen-by-using-ip-aliasing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Awstats, Libperl-Storage, and endianness (Byte Order) issues</title>
		<link>http://www.dalouche.com/wordpress/2006/11/22/awstats-libperl-storage-and-endianness-byte-order-issues/</link>
		<comments>http://www.dalouche.com/wordpress/2006/11/22/awstats-libperl-storage-and-endianness-byte-order-issues/#comments</comments>
		<pubDate>Wed, 22 Nov 2006 17:12:21 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Unix / Linux</category>

		<category>Tips and Documentation</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/11/22/awstats-libperl-storage-and-endianness-byte-order-issues/</guid>
		<description><![CDATA[If you have recently migrated your AWstats to a different Architecture (Pentium4 to AMD64, for instance), awstats may report you the following error :
Warning: Error while retrieving hashfile: Byte order is not compatible at ../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/_retrieve.al) line 331, at (eval   line 1
This is caused by the fact that awstats/perl caches DNS [...]]]></description>
			<content:encoded><![CDATA[<p>If you have recently migrated your AWstats to a different Architecture (Pentium4 to AMD64, for instance), awstats may report you the following error :</p>
<blockquote><p>Warning: Error while retrieving hashfile: Byte order is not compatible at ../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/_retrieve.al) line 331, at (eval <img src='http://www.dalouche.com/wordpress/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' />  line 1</p></blockquote>
<p>This is caused by the fact that awstats/perl caches DNS Entries in a machine-dependant  way. Others have experienced the same problems, like on <a href="http://forums.sixapart.com/index.php?showtopic=42046">this forum</a>.</p>
<p>The solution is actually quick. Let&#8217;s say your stats are in /stats, you can do :</p>
<blockquote><p>find /stats -name &#8216;*.hash&#8217; -exec rm {} \;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/11/22/awstats-libperl-storage-and-endianness-byte-order-issues/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HOWTO: Apache2 + Awstats setup on Debian/Ubuntu (Edgy Eft)</title>
		<link>http://www.dalouche.com/wordpress/2006/11/22/howto-apache2-awstats-setup-on-debianubuntu-edgy-eft/</link>
		<comments>http://www.dalouche.com/wordpress/2006/11/22/howto-apache2-awstats-setup-on-debianubuntu-edgy-eft/#comments</comments>
		<pubDate>Wed, 22 Nov 2006 17:07:09 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Unix / Linux</category>

		<category>Tips and Documentation</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/11/22/howto-apache2-awstats-setup-on-debianubuntu-edgy-eft/</guid>
		<description><![CDATA[Here is a simple HOWTO explaining how to configure AWstats to analyze Apache2 logs, and provide detailed statistics, under Ubuntu Edgy Eft. This should also work for other Ubuntu versions, as well as any Debian derivative.
Apache
The first step is to activate Logging in Apache, so that Awstats has something to analyze. For instance, you can [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple HOWTO explaining how to configure AWstats to analyze Apache2 logs, and provide detailed statistics, under Ubuntu Edgy Eft. This should also work for other Ubuntu versions, as well as any Debian derivative.</p>
<p><strong>Apache</strong></p>
<p>The first step is to activate Logging in Apache, so that Awstats has something to analyze. For instance, you can add something similar in your VirtualHost configuration :</p>
<blockquote><p>ErrorLog /var/log/apache2/sirika.com-error.log<br />
CustomLog /var/log/apache2/sirika.com-access.log combined</p></blockquote>
<p>Another important thing is to configure a few things for awstats in apache, like where the icons are, and more importantly, to activate CGI-scripts (since AWstats is written in perl&#8230;) . This can be done thanks to the following /etc/apache2/conf/awstats.conf :</p>
<blockquote><p># This provides worldwide access to everything below the directory<br />
# Security concerns:<br />
#  * Raw log processing data is accessible too for everyone<br />
#  * The directory is by default writable by the httpd daemon, so if<br />
#    any PHP, CGI or other script can be tricked into copying or<br />
#    symlinking stuff here, you have a looking glass into your server,<br />
#    and if stuff can be uploaded to here, you have a public warez site!</p>
<p>Options None<br />
AllowOverride None<br />
Order allow,deny<br />
Allow from all<br />
# This provides worldwide access to everything below the directory<br />
# Security concerns: none known</p>
<p>Options None<br />
AllowOverride None<br />
Order allow,deny<br />
Allow from all</p>
<p># This provides worldwide access to everything in the directory<br />
# Security concerns: none known<br />
Alias /awstats-icon/ /usr/share/awstats/icon/</p>
<p># This (hopefully) enables _all_ CGI scripts in the default directory<br />
# Security concerns: Are you sure _all_ CGI scripts are safe?<br />
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/</p></blockquote>
<p><strong>Awstats </strong></p>
<p>The next step is to install awstats, with all the necessary perl modules.. Using several optional modules implies that you have installed them. liburi-perl is useful if you use the &#8220;decodeutfkeys&#8221; module, even though it is NOT listed as recommended or suggested in the awstats package.</p>
<blockquote><p>sudo apt-get install awstats libnet-dns-perl libnet-ip-perl libgeo-ipfree-perl liburi-perl libnet-xwhois-perl</p></blockquote>
<p>Once this is working, it is now necessary to configure awstats, to tell it which logs it should monitor, and where it should write its working files (stats). This is done by creating a file /etc/awstats/awstats.website.conf (replace website by your apache2 virtual host name, for instance, and do NOT forget the .conf !).</p>
<blockquote><p>sudo cp /etc/awstats/awstats.conf /etc/awstats/awstats.website.conf</p></blockquote>
<p>Editing this file should be pretty straightforward, since it is well commented. In particular, pay attention to the following entries</p>
<blockquote><p>LogFile=&#8221;/var/log/apache2/sirika.com-access.log&#8221;</p>
<p>SiteDomain=&#8221;sirika.com&#8221;</p>
<p>HostAliases=&#8221;www.sirika.com&#8221;</p>
<p>DirData=&#8221;/srv/data/stats/sirika.com&#8221;</p></blockquote>
<p>LogFile should point to the log file configured in Apache2.</p>
<p>SiteDomain is the main domain name, as configured in Apache2.</p>
<p>HostAliases should list ALL the aliases listed in Apache2&#8217;s VirtualHost configuration. Usually, you will want the same domain prefixed with www, (or without the www prefix if is it already specified in the main domain name). This is really annoying, error-prone and not having a global definition of a &#8220;virtual host&#8221; on the system is one of the issues I pointed in &#8220;<a href="http://samokk.is-a-geek.com/wordpress/2006/01/22/10-things-that-still-suck-under-linux/">10 things that still suck under linux</a>&#8220;. Virtual hosts and aliases should be defined once, globally. Every single concept/thing should be repeated/configured once, and only once, on a perfect system. Anyways&#8230;</p>
<p>DirData should point to an empty directory, whose content will be managed by Awstats.<br />
<strong> Cron</strong></p>
<p>Everything is now configured.  On a perfect system, the setup would stop now. Awstats could be automagically notified for every change in the logs (awstats could register to a so-called &#8220;http access event&#8221;, and its internal behaviour could define its policy for updating the stats (update synchronously, update asynchronously when the system is idle, etc..). This is one of the things I pointed out in &#8220;<a href="http://samokk.is-a-geek.com/wordpress/2006/01/22/10-things-that-still-suck-under-linux/">10 things that still suck under linux</a>&#8220;. However, we&#8217;re not there yet, so, we need to run the script every day to update the stats. (yeah, that&#8217;s the reality today..)</p>
<p>So, this can be done thanks to the following /etc/cron.daily/awstats (do not forget to chmod +x /etc/cron.daily/awstats after creating it) :</p>
<blockquote><p>#!/bin/sh</p>
<p>/usr/share/doc/awstats/examples/awstats_updateall.pl -awstatsprog=/usr/lib/cgi-bin/awstats.pl now > /dev/null</p></blockquote>
<p>This will  update all the statistics for all the hosts defined in /etc/awstats/*, on a daily basis. Yes, it&#8217;s not as beautiful as having a full-featured event-system for which every application could attach to events generated by others, but it has the merits of working&#8230;</p>
<p><strong>Logrotate</strong></p>
<p>What happens when your apache logs get rotated (and possibly gzipped, etc) by logrotate (apt-cache show logrotate for more information), and awstats still hasn&#8217;t analyzed the end of the logs that is about to be rotated ?</p>
<p>To avoid this situation, it is necessary to tell logrotate to launch awstats BEFORE rotating the logs. This can be done by adding the following lines to /etc/logrotate.d/apache2 :</p>
<blockquote><p>prerotate<br />
/etc/cron.daily/awstats<br />
endscript</p></blockquote>
<p><strong>Permissions</strong></p>
<p>And of course, permissions must be tweaked :</p>
<ul>
<li>Since Awstats runs as the web users for viewing stats (CGI-script), the web user needs read access to /srv/data/stats/*</li>
<li>Additionnally, you may want to provide the &#8220;update now&#8221; button on your website stats. So, the web  user also needs write access to /srv/data/stats/*</li>
<li>Finally, awstats needs access to the apache2 logs to create the stats. This is not a problem when it is run from a cron script, since it is run as root. But, in the case of &#8220;update now&#8221;, it runs as the web server, so the web server needs read access to its logs. (the default permissions are 660 with root:adm), so www-data doesn&#8217;t have access to its logs</li>
</ul>
<p>The problem with traditional permissions is that there is no decent way of specifying default permissions. So, we are going to use ACLs for that. You can find more information about them <a href="http://samokk.is-a-geek.com/wordpress/2006/01/14/using-posix-acls-to-complement-traditional-linux-permissions/">here (Using POSIX ACLs to complement traditional Linux permissions)</a>. So, this gives, for instance :</p>
<blockquote><p># read write execute access  for web user to the stats directories<br />
find /srv/data/stats -type d -exec setfacl -m &#8220;g:www-data:rwx&#8221; {} \;</p>
<p># read write execute access for FUTURE stats files for the web users</p>
<p>find /srv/data/stats -type d -exec setfacl -d -m &#8220;g:www-data:rwx&#8221; {} \;</p>
<p># read write access to the stats files  for the web user<br />
find /srv/data/stats -type f -exec setfacl -d -m &#8220;g:www-data:rw-&#8221; {} \;</p>
<p># read  only access to the logs directory for the web user<br />
find /var/log/apache2 -type d -exec setfacl -m &#8220;g:www-data:r-x&#8221; {} \;</p>
<p># read  only access to the logs for the web user, for future files</p>
<p>find /var/log/apache2 -type d -exec setfacl -d -m &#8220;g:www-data:r-x&#8221; {} \;</p>
<p># read  only access to the apache2 logs for the web user<br />
find /var/log/apache2 -type f -exec setfacl -m &#8220;g:www-data:r&#8211;&#8221; {} \;</p></blockquote>
<p>And it should work.. The last thing would be to protect access to your logs, if you don&#8217;t want your users to see them. This can be done using a .htaccess file, and there are plenty of tutorials on the web that explain how to achieve that.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/11/22/howto-apache2-awstats-setup-on-debianubuntu-edgy-eft/feed/</wfw:commentRss>
		</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>skoobi</dc:creator>
		
		<category>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 - usually Spring - 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>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/11/18/the-typical-bleeding-edge-web-application-architecture/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Xen and SELinux : anything in common ?</title>
		<link>http://www.dalouche.com/wordpress/2006/11/18/xen-and-selinux-anything-in-common/</link>
		<comments>http://www.dalouche.com/wordpress/2006/11/18/xen-and-selinux-anything-in-common/#comments</comments>
		<pubDate>Sat, 18 Nov 2006 13:32:35 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Unix / Linux</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/11/18/xen-and-selinux-anything-in-common/</guid>
		<description><![CDATA[Xen is definitely a great piece of software. It is currently the only viable (truly) Open Source solution to build secure virtual systems by isolating software in their own sandbox, and being able to set CPU/Memory restrictions on each of the sub systems.
However, each subsystem has to be managed and upgraded separately.  This means [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Xen">Xen</a> is definitely a great piece of software. It is currently the only viable (truly) Open Source solution to build secure virtual systems by isolating software in their own sandbox, and being able to set CPU/Memory restrictions on each of the sub systems.</p>
<p>However, each subsystem has to be managed and upgraded separately.  This means that each subsystem is a (nearly) complete system that must be administrated in its own. Another aspect is User Management, since some users may need to be propagated. An <a href="http://en.wikipedia.org/wiki/LDAP">LDAP</a> repository can be used to avoid the ugly <a href="http://en.wikipedia.org/wiki/Network_Information_Service">NIS</a>-like propagation, but one needs to define a policy regarding how the users are laid-out in the directory and how the directory is used, since not all virtual machines may be accessed by all users&#8230; And user management also implies the usual sharing of /home, for which most people use the old and broken (though working ) <a href="http://en.wikipedia.org/wiki/Network_File_System">NFS</a> .<br />
Monitoring is also an important topic in this area : open source monitoring solutions like <a href="http://www.opennms.org/index.php/Main_Page">OpenNMS</a> must be leveraged in order to monitor all the servers. This is another layer of complexity, that isn&#8217;t necessarily needed.</p>
<p>So now, what I am wondering about is why all the buzz goes to Xen, and nobody really cares about SELinux (except maybe Red Hat which seems to provide decent <a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide/">SELinux support</a> in its distribution). Ubuntu, in any case, does not seem to <a href="http://www.michaeldolan.com/419">make SELinux its priority</a>, as Michael Dolan highlights it.</p>
<p>Sure, Xen and SELinux are not meant to tackle the same problems. Xen is a virtualization layer, whereas SELinux is a security layer. However, the problem, I believe, is that people tend to use Xen to tackle security problems that SELinux could solve without the need of additional  systems.  Of course, for complex  needs, Xen+SELinux could be envisionned, but the philosophy behind virtualization is that the system is dumb from a security perspective, whereas SELinux tries to fix the heart of the problems : making a multi-user system secure.</p>
<p>In fact, why would anyone want to setup of a full-blown virtual server just to run a DNS server, if some security stack could protect the rest of the system from being damaged in the case that the DNS daemon would get hacked ?
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/11/18/xen-and-selinux-anything-in-common/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RAID 5 vs RAID 50 (informal comparison/benchmark)</title>
		<link>http://www.dalouche.com/wordpress/2006/11/17/raid-5-vs-raid-50-informal-comparisonbenchmark/</link>
		<comments>http://www.dalouche.com/wordpress/2006/11/17/raid-5-vs-raid-50-informal-comparisonbenchmark/#comments</comments>
		<pubDate>Fri, 17 Nov 2006 23:38:06 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Unix / Linux</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/11/17/raid-5-vs-raid-50-informal-comparisonbenchmark/</guid>
		<description><![CDATA[OK, so you just bought that wonderful 4U server, with dual-core Xeon/Core 2 Duo, redundant gigabit ethernet connections, redundant power supplies, KVM over IP / IPMI management card, and most importantly, this wonderful fully hardware-based RAID controller (Semi-Soft RAID has been a disaster for me, by the way).
Now, the question is : Should you use [...]]]></description>
			<content:encoded><![CDATA[<p>OK, so you just bought that wonderful <a href="http://en.wikipedia.org/wiki/Rack_unit">4U</a> server, with dual-core Xeon/Core 2 Duo, redundant gigabit ethernet connections, redundant power supplies, <a href="http://en.wikipedia.org/wiki/KVM_switch">KVM over IP</a> / <a href="http://en.wikipedia.org/wiki/IPMI">IPMI</a> management card, and most importantly, this wonderful fully hardware-based RAID controller (Semi-Soft RAID has been <a href="http://samokk.is-a-geek.com/wordpress/2006/01/15/running-ubuntu-gnulinux-on-a-fakeraid1-mirroring-array/">a disaster</a> for me, by the way).</p>
<p>Now, the question is : Should you use <a href="http://en.wikipedia.org/wiki/RAID_5#RAID_5">RAID 5</a>, <a href="http://en.wikipedia.org/wiki/RAID_5#RAID_50_.28RAID_5.2B0.29">RAID 50</a> or something else ? Choosing between simple RAID solutions like <a href="http://en.wikipedia.org/wiki/RAID_5#RAID_0">RAID 0</a> vs <a href="http://en.wikipedia.org/wiki/RAID_5#RAID_1">RAID 1</a> is pretty easy, and one can easily conclude that RAID 0 is for performance (especially writes), whereas RAID 1 is for security.  (even though it helps reads). Please note that RAID 1 is very expensive in disk space&#8230;<br />
Now, what about the &#8220;standard&#8221; RAID 3, 4, 5, 5E, 6, 6E levels, or the &#8220;nested&#8221; ones such as RAID 0+1, 10, 30, 100, 50, 60 ?</p>
<p>In fact, the right choice depends on your specific needs (which is the lovely sentence everyone will  use to avoid giving his opinion).</p>
<p>Now, in practice, my personal opinion on that :</p>
<ul>
<li>RAID 3 and RAID 4 are only theoretical RAID levels that nobody actually uses.</li>
<li>RAID 5E, RAID 6 and RAID 6E are probably very good RAID levels, but the RAID card I use doesn&#8217;t support it, so I suspect these levels to be only available in higher-end models. If you are lucky enough to try one of those, I would be happy to hear about the performance.</li>
<li>Most of the other nested RAID levels either are not supported by hardware cards, or are very expensive to implement. So, if you can spend money for them, their evaluation might be good.</li>
</ul>
<p>After these considerations,  and considering that you want a certain balance between <strong>security,</strong> <strong>performance</strong> and <strong>price,</strong> you might want to compare RAID 5 and RAID 50, which are both good compromises between these concerns.</p>
<p>To put it simply let&#8217;s consider you have 8 disks. RAID 5 stripes the data over 7 disks, and uses the 8th one for parity checking, so that it can rebuild the data if one disk fails (this is a little simplistic, since no disk is dedicated to partity and the parity blocks are rotated over the disks, but you get the idea).</p>
<p>RAID 5+0 creates 2 RAID arrays with half of the disks, and creates a RAID 0 array (stripping) on top of  that. As a result, it is more costly, since 2 disks are used for parity checking instead of one, but is more robust to failures (2 failures are allowed).</p>
<p>It is often said that RAID 5+0 is more efficient for writes&#8230; So I wanted to compare how better it is, if ever it is, on a  <em>3ware 9550SX 8 port SATA II RAID controller</em> with write cache enabled, and  <em>8 SATA 300 GB Maxtor DiamondMax 10</em><br />
So, the result is a set of informal benchmarks, that are probably not related to the way I am going to use the disk anyways, but that has the merit of drawing quick conclusions :<br />
First of all, using RAID 5</p>
<blockquote><p>sudo dd if=/dev/sda of=/dev/null bs=1M count=1024<br />
10240+0 records in<br />
10240+0 records out<br />
10737418240 bytes (11 GB) copied, 32.7535 seconds, 328 MB/s</p></blockquote>
<blockquote><p>dd if=/dev/zero of=out bs=1M count=10240<br />
10240+0 records in<br />
10240+0 records out<br />
10737418240 bytes (11 GB) copied, 88.8292 seconds, 121 MB/s</p></blockquote>
<blockquote><p>dd if=./out of=/dev/null<br />
20971520+0 records in<br />
20971520+0 records out<br />
10737418240 bytes (11 GB) copied, 45.3929 seconds, 237 MB/s</p></blockquote>
<blockquote />
<blockquote><p>dd if=/dev/zero of=ok bs=1M count=1<br />
500 MB / sec<br />
dd if=ok of=/dev/null<br />
630 MB / s<br />
dd if=/dev/zero of=ok bs=1 count=1<br />
40/43 kB / sec (Yes, KB)</p>
<p>dd if=ok of=/dev/null<br />
0+1 records in<br />
0+1 records out<br />
1 byte (1 B) copied, 1.5e-05 seconds, 66.7 kB/s</p>
<p>dd if=./out of=/dev/null<br />
20971520+0 records in<br />
20971520+0 records out<br />
10737418240 bytes (11 GB) copied, 49.5834 seconds, 217 MB/s</p>
<p>dd if=/dev/zero of=ok bs=1k count=1<br />
44 MB / sec</p>
<p>dd if=ok of=/dev/null<br />
2+0 records in<br />
2+0 records out<br />
1024 bytes (1.0 kB) copied, 1.7e-05 seconds, 60.2 MB/s</p>
<p>rm -f ok ; dd if=/dev/zero of=ok bs=1k count=4<br />
4+0 records in<br />
4+0 records out<br />
4096 bytes (4.1 kB) copied, 3.4e-05 seconds, 120 MB/s<br />
120/ 130 MB /s</p>
<p>rm -f ok ; dd if=/dev/zero of=ok bs=1k count=16<br />
16+0 records in<br />
16+0 records out<br />
16384 bytes (16 kB) copied, 8.4e-05 seconds, 195 MB/s</p>
<p>time ( for (( i=0; i < 100000  ; i++ )) ; do dd if=/dev/zero of=$i.out bs=1k count=1 2> /dev/null; done )</p>
<p>real    10m0.205s<br />
user    1m45.403s<br />
sys     8m2.134s</p>
<p>time ( for (( i=0; i < 100000  ; i++ )) ; do dd if=/dev/zero of=$i.out bs=1 count=1 2> /dev/null; done )</p>
<p>real    3m19.841s<br />
user    1m43.242s<br />
sys     1m34.582s</p>
<p>time ( for (( i=0; i < 100000  ; i++ )) ; do dd if=/dev/zero of=$i.out bs=1 count=1 2> /dev/null; done )</p>
<p>real    10m52.149s<br />
user    1m46.703s<br />
sys     9m4.218s</p>
<p>time ( for (( i=0; i < 1000  ; i++ )) ; do dd if=/dev/zero of=$i.out bs=1<br />
count=1 2> /dev/null; done )</p>
<p>real    0m20.931s<br />
user    0m1.068s<br />
sys     0m3.260s</p></blockquote>
<p>And now, parts of the results on RAID 50 :</p>
<blockquote />
<blockquote><p>dd if=/dev/sda of=/dev/null bs=1M count=10240<br />
Password:<br />
10240+0 records in<br />
10240+0 records out<br />
10737418240 bytes (11 GB) copied, 40.1916 seconds, 267 MB/s</p>
<p>dd if=/dev/zero of=out bs=1M count=10240<br />
10240+0 records in<br />
10240+0 records out<br />
10737418240 bytes (11 GB) copied, 117.762 seconds, 91.2 MB/s</p>
<p>dd if=/dev/zero of=ok bs=1M count=1<br />
1+0 records in<br />
1+0 records out<br />
1048576 bytes (1.0 MB) copied, 0.085963 seconds, 12.2 MB/s</p>
<p>dd if=ok of=/dev/null<br />
2048+0 records in<br />
2048+0 records out<br />
1048576 bytes (1.0 MB) copied, 0.001741 seconds, 602 MB/s</p>
<p>dd if=/dev/zero of=ok bs=1 count=1<br />
1+0 records in<br />
1+0 records out<br />
1 byte (1 B) copied, 3.5e-05 seconds, 28.6 kB/s<br />
dd if=ok of=/dev/null<br />
0+1 records in<br />
0+1 records out<br />
1 byte (1 B) copied, 1.7e-05 seconds, 58.8 kB/s</p>
<p>dd if=/dev/zero of=ok bs=1k count=1<br />
1+0 records in<br />
1+0 records out<br />
1024 bytes (1.0 kB) copied, 3.4e-05 seconds, 30.1 MB/s</p>
<p>dd if=ok of=/dev/null<br />
2+0 records in<br />
2+0 records out<br />
1024 bytes (1.0 kB) copied, 1.9e-05 seconds, 53.9 MB/s</p>
<p>time ( for (( i=0; i < 1000  ; i++ )) ; do dd if=/dev/zero of=$i.out bs=1M count=1 2> /dev/null; done )</p>
<p>real    0m15.759s<br />
user    0m1.068s<br />
sys     0m3.180s</p>
<p>time ( for (( i=0; i < 100000  ; i++ )) ; do dd if=/dev/zero of=$i.out bs=1k count=1 2> /dev/null; done )</p>
<p>real    9m46.112s<br />
user    1m44.779s<br />
sys     7m59.798s</p></blockquote>
<p>So, my conclusion (which I repeat, is not rocket science) is that RAID 50 isn&#8217;t that much better than RAID 5, and is sometimes actually worse, though more expensive. As a result, my personal choice has been RAID 5.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/11/17/raid-5-vs-raid-50-informal-comparisonbenchmark/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Funny quote:  Java vs PHP</title>
		<link>http://www.dalouche.com/wordpress/2006/11/04/funny-quote-java-vs-php/</link>
		<comments>http://www.dalouche.com/wordpress/2006/11/04/funny-quote-java-vs-php/#comments</comments>
		<pubDate>Sat, 04 Nov 2006 21:25:57 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Uncategorized</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/11/04/funny-quote-java-vs-php/</guid>
		<description><![CDATA[The  Can Java CMS match PHP ones article contains a funny, yet sadly true, sentence :
Maybe while the Java world was engaged in talking of high end, super techie stuff, with the words &#8216;enterprise&#8217;, &#8216;transactions&#8217; and &#8216;SOA &#8216;embedded in every sentence, the PHP guys actually went out and created a lot of simple yet very [...]]]></description>
			<content:encoded><![CDATA[<p>The  <a href="http://www.indicthreads.com/blogs/161/Java_PHP_CMS_Comparison.html">Can Java CMS match PHP ones</a> article contains a funny, yet sadly true, sentence :</p>
<blockquote><p>Maybe while the Java world was engaged in talking of high end, super techie stuff, with the words &#8216;enterprise&#8217;, &#8216;transactions&#8217; and &#8216;SOA &#8216;embedded in every sentence, the PHP guys actually went out and created a lot of simple yet very useful software.</p></blockquote>
<p>And we can also cite the following article : <a href="http://discuss.joelonsoftware.com/default.asp?joel.3.219431.12">Why I hate frameworks</a> which goes in the same direction, and is pretty funny too <img src='http://www.dalouche.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/11/04/funny-quote-java-vs-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Designing Java migration scripts for SQL/Hibernate/Java Persistence API data</title>
		<link>http://www.dalouche.com/wordpress/2006/06/18/designing-java-migration-scripts-for-sqlhibernatejava-persistence-api-data/</link>
		<comments>http://www.dalouche.com/wordpress/2006/06/18/designing-java-migration-scripts-for-sqlhibernatejava-persistence-api-data/#comments</comments>
		<pubDate>Sun, 18 Jun 2006 19:39:00 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Uncategorized</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/06/18/designing-java-migration-scripts-for-sqlhibernatejava-persistence-api-data/</guid>
		<description><![CDATA[Every web application needs to load initial data into its production database (settings and domain specific data such as available categories, etc..).
Another concern is the migration of current data to the new schema. Hibernate/JPA makes it easy to create additional fields, but as soon as data migration is needed, it is necessary to have something [...]]]></description>
			<content:encoded><![CDATA[<p>Every web application needs to load initial data into its production database (settings and domain specific data such as available categories, etc..).</p>
<p>Another concern is the migration of current data to the new schema. Hibernate/JPA makes it easy to create additional fields, but as soon as data migration is needed, it is necessary to have something more robust.</p>
<p>That is my current concern : I want to create a decent import/migration system.</p>
<p><strong>Requirements :</strong></p>
<ul>
<li>Versioning : Launching a migration should detect the current state of the database without breaking things if the data is up to date</li>
<li>Heterogeneity-friendly :  Some data come from  XML, others are plain SQL  scripts,  some are  calculated&#8230;. So, the importer system should play well with many kinds of sub-importers.</li>
<li>Transaction-enabled : if an importer crashes, it must leave the data in the previous state</li>
<li>Developer-friendly and extensible : it should be easy to add new importers for additional sets of data</li>
</ul>
<p>I am still unsure about how I should do things, so if anyone has already worked on something similar, I am open to ideas.</p>
<p>In any case, once I work out something nice, I&#8217;ll re-post
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/06/18/designing-java-migration-scripts-for-sqlhibernatejava-persistence-api-data/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AJAX frameworks comparison</title>
		<link>http://www.dalouche.com/wordpress/2006/02/27/ajax-frameworks-comparison/</link>
		<comments>http://www.dalouche.com/wordpress/2006/02/27/ajax-frameworks-comparison/#comments</comments>
		<pubDate>Mon, 27 Feb 2006 09:04:59 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Web Development</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/02/27/ajax-frameworks-comparison/</guid>
		<description><![CDATA[Daniel provides a comparison of AJAX frameworks . It is especially useful these days since everyone is starting to develop his own AJAX framework.
Not all frameworks are presented (reasons explained), but it&#8217;s a good start. Keep up the good work !

]]></description>
			<content:encoded><![CDATA[<p>Daniel provides a <a href="http://geekswithblogs.net/danielz/archive/2006/02/25/70698.aspx">comparison of AJAX frameworks </a>. It is especially useful these days since everyone is starting to develop his own AJAX framework.</p>
<p>Not all frameworks are presented (reasons explained), but it&#8217;s a good start. Keep up the good work !
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/02/27/ajax-frameworks-comparison/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Aspect-Oriented Programming</title>
		<link>http://www.dalouche.com/wordpress/2006/02/15/aspect-oriented-programming/</link>
		<comments>http://www.dalouche.com/wordpress/2006/02/15/aspect-oriented-programming/#comments</comments>
		<pubDate>Wed, 15 Feb 2006 20:47:15 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>Methodologies</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/02/15/aspect-oriented-programming/</guid>
		<description><![CDATA[This very nice article from IBM gives some information about Aspect-Oriented Programming (AOP), and why it is good for programmers.
The author clears the myths and understanding about AOP.

]]></description>
			<content:encoded><![CDATA[<p><a href="http://www-128.ibm.com/developerworks/java/library/j-aopwork15/">This</a> very nice article from IBM gives some information about Aspect-Oriented Programming (AOP), and why it is good for programmers.</p>
<p>The author clears the myths and understanding about AOP.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/02/15/aspect-oriented-programming/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Basic Db4o Integration with Spring.NET</title>
		<link>http://www.dalouche.com/wordpress/2006/02/12/basic-db4o-integration-with-springnet/</link>
		<comments>http://www.dalouche.com/wordpress/2006/02/12/basic-db4o-integration-with-springnet/#comments</comments>
		<pubDate>Sun, 12 Feb 2006 17:59:24 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>.NET</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/02/12/basic-db4o-integration-with-springnet/</guid>
		<description><![CDATA[Basic Integration of Db4o with Spring.NET is now done. Nothing has been tested yet, but testing should soon start&#8230;
I have created a JIRA issue for this. I hope that this will get integrated and reviewed into Spring.NET.
Content of the issue :
It would be nice to have Spring.NET integrated with db4o.
I have implemented basic integration here [...]]]></description>
			<content:encoded><![CDATA[<p>Basic Integration of Db4o with Spring.NET is now done. Nothing has been tested yet, but testing should soon start&#8230;</p>
<p>I have created a <a href="http://opensource2.atlassian.com/projects/spring/browse/SPRNET-288">JIRA issue</a> for this. I hope that this will get integrated and reviewed into Spring.NET.</p>
<p>Content of the issue :</p>
<blockquote><p>It would be nice to have Spring.NET integrated with db4o.<br />
I have implemented basic integration here :<br />
<a href="http://samokk.is-a-geek.com/Projects/Spring.Net/db4o.tar.gz">http://samokk.is-a-geek.com/Projects/Spring.Net/db4o.tar.gz</a></p>
<p>Nothing has been tested yet.<br />
I&#8217;ll post updates to the same address.</p>
<p>The current version supports :<br />
- Db4o Platform Transaction Manager :<br />
- Db4o Template, that supports both ICallback and delegate method.<br />
- Db4oUtils, that provides utilities to create / dispose connections<br />
- IDb4oDataSource / BasicDb4oDataSource : the exact same thing as a Java JDBC DataSource (Abstract Factory), but for Db4o. BasicDb4oDataSource delegate connection creation to 4 concrete IDb4oConnectionParameters :<br />
* FileDb4oConnectionParameters : Direct file access<br />
* MemoryDb4oConnectionParameters : In-memory database<br />
* EmbeddedClientDb4oConnectionParameters : client to an embedded server<br />
* RemoteClientDb4oConnectionParameters : client to a remote server</p>
<p>These classes work with the Spring.Data classes I found in the sandbox. Do not hesitate to add them to CVS, they are licensed under whatever-license suits you (Apache, BSD, LGPL, whatever)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/02/12/basic-db4o-integration-with-springnet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More details about Integrating Db4o with Spring.NET</title>
		<link>http://www.dalouche.com/wordpress/2006/02/10/more-details-about-integrating-db4o-with-springnet/</link>
		<comments>http://www.dalouche.com/wordpress/2006/02/10/more-details-about-integrating-db4o-with-springnet/#comments</comments>
		<pubDate>Sat, 11 Feb 2006 01:53:26 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>.NET</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/02/10/more-details-about-integrating-db4o-with-springnet/</guid>
		<description><![CDATA[After having spent several more hours on the Db4o/Spring.NET integration issue, here are some of my conclusions concerning Spring.NET internals :
Most of the logic for integrating a Data Access/Transaction support technology to Spring.NET is to be implemented inside 3 major entities :

The PlatformTransactionManager (Db4oPlatformTransationManager) : definitely the main entity on the system, its purpose is [...]]]></description>
			<content:encoded><![CDATA[<p>After having spent several more hours on the Db4o/Spring.NET integration issue, here are some of my conclusions concerning Spring.NET internals :</p>
<p>Most of the logic for integrating a Data Access/Transaction support technology to Spring.NET is to be implemented inside 3 major entities :</p>
<ul>
<li>The PlatformTransactionManager (Db4oPlatformTransationManager) : definitely the main entity on the system, its purpose is to manage the transactions (Commit, Rollback, and Get a (New/Existing) Transaction.</li>
<li>The Utilities (Db4oUtils) : Its role is mainly to create / dispose connections. However, it does NOT blindly create connections and dispose them. In fact, it must take into account the fact that most applications are multithreaded (e.g. Web Sites), so the releasing a connection must not affect another thread&#8217;s connection.</li>
<li>The Template (Db4oTemplate) : Its role is simply to remove the connection creation/release burden from user code. The template takes care of dealing with Spring.NET internals, threads, synchronization, etc. As a result, the user code just deals with a connection to the database that it can use to perform its tasks.</li>
</ul>
<p>Let&#8217;s see how everything fits together :</p>
<ul>
<li>First of all, it is important to realize that connection creation is an important part of the whole system. In fact, in a multi-threaded environment, several concurrent accesses to the database will be necessary. As a result, it is not possible to have code (e.g. Data Access Objects - DAO) keep references to active connections since it woud mess the whole system. To concurrently access the same database at the same time, several threads must use different connections, so data access code should not maintain references to connections.<br />
As a result, most parts of Spring.NET (Template, etc) will keep a reference to a Factory Object that allows the creation of connections, instead of keeping a reference to a connection directly. This Factory is the DataSource, in the case of Spring Java and IDb4oDataSource in the case of my Db4o to Spring.NET integration.</li>
<li>The Spring.NET templates <em>(Db4oTemplate)</em> allow the removal of connection references from Data Access Objects. Indeed, when using templates, DAOs provide delegates (implemented as Object callbacks for Spring Java, since delegates (function pointers) do not exist in Java) whose signature is given by the template. The delegate has the connection object passed as a parameter, so the DAO can actually perform its work without having to care about which connection it will work on. Look at Spring (Java) <a href="http://static.springframework.org/spring/docs/1.2.x/reference">reference manual</a> which gives quite a lot of information about this.<br />
As a result, all the connection creation/release tasks are handled by the template instead of the user. This is coded once in the template, and avoids unecessary boilerplate code. Basicaly, here is how (roughly) a template Execute method is coded :</li>
<ul>
<li>Get a Connection</li>
<li>Call the delegate provided by the user : delegateMethod(Connection)</li>
<li>Close the Connection</li>
</ul>
<li>However, Connection Creation and Release is a quite complex task. As a result, it is handled by a utilitary class :<em> Db4oUtils</em>. Here is why it is complex :</li>
<ul>
<li>Connections used by each Thread should be handled separately. Thread X should not mess with Thread Y&#8217;s connection, or it would lead to race conditions.</li>
<li>It is not possible nor desirable to create a new connection each time a connection is requested. In fact, the connection should be kept until the transaction is Commit&#8217;ed or Rollback&#8217;ed, and several calls to GetConnection() can happen before, if, for example, several Db4oTemplates are used.</li>
<li>Sometimes, we do not want to take part in a Transaction, so the case where there is no transaction to synchronize to should also be taken into consideration.</li>
<li>Additionnally, Exceptions should be converted to Spring.NET exception Hierarchy..</li>
</ul>
<li>In order to handle  each thread&#8217;s connection separately, a <em>TransactionSynchronizationManager</em> is used. Its role is simply to associate resources and give different resource-spaces to each thread.</li>
<li>The resources that the <em>TransactionSynchronizationManager</em> deals with are not the connections direcltly, but <em>ConnectionHolders</em>. The subtle difference is that the holder maintains a reference to the Connection, but also keeps some information such as a reference count of users of the connection. So, in the case of  nested GetConnection() calls, the reference count will indicate that the resource is still used even though a Dispose() will be done after the nested GetConnection().</li>
<li>The <em>TransactionSynchronizationManager</em> uses  an event-based approach with listeners (called Synchronizations to the resources) in order to do the cleanup of the resources; Since the <em>TransactionSynchronizationManager</em> works with all kinds of connections (ADO.NET, Db4o, etc), it cannot understand how it should cleanup resources after a cleanup, so this is the task of a Synchronization that listen to events thrown by the Manager.</li>
</ul>
<p>Previous issues :</p>
<ul>
<li><a href="http://samokk.is-a-geek.com/wordpress/2006/02/07/adding-db4o-oo-database-support-for-springnet-transactions/">Adding db4o OO database support for Spring.NET</a></li>
<li><a href="http://samokk.is-a-geek.com/wordpress/2006/02/09/springnet-and-db4o-integration/">Spring.NET and db4o Integration roadmap</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/02/10/more-details-about-integrating-db4o-with-springnet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Spring.NET and db4o Integration roadmap</title>
		<link>http://www.dalouche.com/wordpress/2006/02/09/springnet-and-db4o-integration/</link>
		<comments>http://www.dalouche.com/wordpress/2006/02/09/springnet-and-db4o-integration/#comments</comments>
		<pubDate>Thu, 09 Feb 2006 23:12:23 +0000</pubDate>
		<dc:creator>skoobi</dc:creator>
		
		<category>.NET</category>

		<guid isPermaLink="false">http://samokk.is-a-geek.com/wordpress/2006/02/09/springnet-and-db4o-integration/</guid>
		<description><![CDATA[As previously stated, I am currently working on Spring.NET and db4o Integration.
This thread  deals with some of my questions regarding what&#8217;s currently available in db4o that will allow me to do the job.
Here&#8217;s the likely roadmap :

Create an equivalent of the JDBC &#8220;Datasource&#8221; : a Factory that allows to create connections regardless of their [...]]]></description>
			<content:encoded><![CDATA[<p>As <a href="http://samokk.is-a-geek.com/wordpress/2006/02/07/adding-db4o-oo-database-support-for-springnet-transactions/">previously</a> stated, I am currently working on Spring.NET and db4o Integration.</p>
<p><a href="http://forums.db4o.com/forums/22449/ShowPost.aspx#22449">This thread</a>  deals with some of my questions regarding what&#8217;s currently available in db4o that will allow me to do the job.</p>
<p>Here&#8217;s the likely roadmap :</p>
<ul>
<li>Create an equivalent of the JDBC &#8220;Datasource&#8221; : a Factory that allows to create connections regardless of their type (embedded, remote, etc). This will help to abstract the connection creation and provide different implementations (Basic, Pooled) of this creation.</li>
<li>Create a Basic non-pooled implementation of this Db4oSource</li>
<li>Implement a Db4oTemplate, probably based on Db4o Native queries (S.O.D.A not doable, unless  something is changed on Db4o side)</li>
<li>Implement the Db4oPlatformTransactionManager and its supporting Db4oUtils classes</li>
<li>Some day, in the future, provide a Pooled implementation of the Datasource. Inspiration from <a href="http://jakarta.apache.org/commons/dbcp/configuration.html">Commons-DBCP</a> will be necessary :</li>
<ul>
<li>A proxy should be created for Db4o ObjectContainer, that would mostly just delegate the processing to a real ObjectContainer, except for the Close(), which would tell the pool that the connection is available</li>
</ul>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dalouche.com/wordpress/2006/02/09/springnet-and-db4o-integration/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Is Architecturing the task of ONE person, not a community ?</title>
		<link>http://www.dalouche.com/wordpress/2006/02/08/is-architectu