Luc Dewavrin ’s web site


OSGI survey

Posted in tech, Java by luc.20.bengali on the May 5th, 2009

The results:

Mimic facelet layouts in grails

Posted in tech, Java by luc.20.bengali on the April 27th, 2009

I wanted to mimic facelets <ui:insert/> and <ui:define/> tags in grails.

I find facelets to be quite powerful because it allows to define a fragment in your template that can be redefined by the view, otherwise a default fragment is displayed.
It can be useful for instance for a menu where you want all views to use a default menu and some use another menu.

In facelets, you would create a template file and add a <ui:insert/> statement for the menu, like this:

<ui:insert name="menu"> 
	<ui:include src="../frags/menu.xhtml"/>
</ui:insert>

Here the <ui:insert/> statement by default includes with the help of the <ui:include/>element a menu fragment (a partial page).

In your view you could if wanted redefine the menu with the <ui:define/> element, like this:

<ui:composition template="layout/template.xhtml">
	<ui:define name="menu">
		<div> Override default menu here </div>
	</ui:define>
</ui:composition>

Grails template system is handled by sitemesh. To achieve the same goal, you can in your template file (layout/main.gsp for instance), add the following element for the menu :

<g:pageProperty name="page.menu" default="${render(template:'/frags/menu')}"/>

It achieves the same purpose, actually instead of defining a page section like in facelets, it displays the calling page’s <content> element named menu if present (control is inverted but the result is the same).
Otherwise, if the <content> element is not found, the menu fragment is rendered.
The fragment page should be in our example created in the frags directory under the name _menu.gsp.

In your view, you can therefore define the menu section of your template by declaring a content element.

<html> 
  <head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta name="layout" content="main" /> 
	<title>Show Book</title>
  </head>
  <body>
	<content tag="menu">
		<div>Override default menu here</div>
	</content
	...
  </body>
</html>

Acquisition de Sun par Oracle

Posted in General by luc.20.bengali on the April 20th, 2009

Pas sûr que Java soit gagnant dans l’histoire. Les incertitudes sur le devenir des produits Java n’est pas fait pour inciter les décideurs à opter pour cette technologie. Quelles sont les futures cibles : SpringSource, Redhat ? Sachant que SpringSource a été largement financé par des VC, à mon avis c’est un bon candidat. Bref, je me mets à la place d’un DSI aujourd’hui; si je ne veux pas prendre de risques j’opte pour .Net et les produits Microsoft : ligne de produits complète, cohérente et intégrée qui ne va pas disparaître d’ici 6 mois (j’exagère un peu…).
Je pense aussi que la période de flottement qui va suivre accentuée en + par une baisse d’investissements liée à la conjoncture va freiner grandement l’innovation autour de la plateforme Java et laisser le champ libre à d’autres technologies. Java n’est pas prêt de combler le retard sur C#. Bref, sans doute quelques mois difficiles en perspective pour la plateforme Java avant d’y voir + clair. 

Seam usage in production

Posted in tech, Java by luc.20.bengali on the March 30th, 2009

There ’s an interesting thread on the Seam forum about Seam in “profesional use”. Performance and steep learning curve are often mentioned as drawbacks.

Seam heavily relies on proxy based components created by javassist. And javassist is known to be unperformant compared to cglib. This library might have been chosen due to politic reason at JBoss. Seam Managed Persistence Context (SMPC) is also seen as a culprit but i guess that like many other frameworks you have to understand what’s underneath the carpet, lazy loading in some use cases can really hit performance.

Scalability is not mentioned but i guess that since Seam is stateful it also can be an issue for large websites.

For the learning curve, it might be true if you don’t come from the JavaEE world or have never developed JSF applications. Seam still requires good knowledge of JSF 1.X and how it corrects it in many ways. The request lifecycle is also complex albeit powerful.Also other “lightweight” JSF based frameworks are quoted like makefaces.

Seam for me is both a IOC container specialized for web development and a web integration framework of Java EE (Ejb,Web beans), JBoss stack (jBPM, Drools, Richfaces, JSFUnit) and commonly used libraries (quartz,jfreechart, itext, javamail,etc.) It also addresses many commonly asked features (conversations, mail sending, page caching,etc.) I am not sure for the future of Seam. Seam 3 might be a complete rewrite due to support of JSF 2 and JSR-299 aka Java Contexts and Dependency Injection, but it is a comprehensive and efficient web framework with a decent IDE (JBoss tools).

Economic downturn and impact on javabloggers

Posted in tech, General, Java by luc.20.bengali on the February 17th, 2009

I wanted to know if the economic crisis had an impact on blogging. I was curious because it seemed for me that the blogs that i usually follow had less activity  . With the help of a groovy script and gchart, here’s the last 2 years monthly blog posts count (don’t know why there’s a high peak for July 07). It seems that, so far, java bloggers still post.

For the quality of the blog posts that’s another story but my blog is not a good example ;-)

JBoss resources

Posted in Java by luc.20.bengali on the February 12th, 2009

I recently discovered 2 good web sites that provide good JBoss knowledge :

- Master the boss : especially with articles with jBPM/JBoss ESB integration, jBPM best practices and JBoss AS tuning (a little bit outdated by the way, but still a good resource).

Enterprise BPM blog : blog by a Redhat engineer involved in jBPM and WS-BPEL jBPM implementation. It has also links to other jBPM related sites.

Next Page »