POC – Project Milestone 2

Leave a comment

October 22, 2010 by huionn

 

In milestone 1, I created login page, 2 simple CRUD pages and dynamic menu. The pages were developed with Seam 2, Richfaces 3.3, Facelets, JPA with Hibernate. Basically the project was kicked started with seam-gen and undergoing heavy customization in layout and components.

The objective at this stage was to evaluate how easy to develop in Seam with help of JBoss Tools.


In milestone 2, the objective is to evaluate the suitability of the platform for large-scale development. After 3 weeks of self-learning and struggling, I would say that Seam is a very mature framework to solve almost all problems. Most problem can be solved easily after googling the right keywords. The remaining 5-10% requires some code reading and debugging. I think the hardest problems are related to Seam’s conversation. While the concept is powerful and lead to lean codes (no parameter passing between servlets, for example), it is hard to troubleshoot the problem at first – why does the conversation end and a new conversation start? Luckily, Seam provides detailed information about conversation in debug page.

– no <conversation> in page.xml or @Begin – no long running conversation

– programmatically end conversation

– GET url without cid

What I have accomplished so far…

  1. split project into Web modules. Inter web apps communication is done through RMI (synchronous point-to-point) and JMS (asynchronous publish/subscribe).
  2. extend Seam’s HibernateEntityQuery for native SQL value objects.
  3. support coss-page multi-page selection – I get the idea from Richfaces ExtendedDataTable and Selection implementation.
  4. develop a functional and highly interactive page with significantly less codes.

I have also briefly profile the performance of Seam application. Seam performance is reasonably fast.

However Richfaces ExtendedDataTable is considered slow compared with DataTable. So, there is cost for rich UI provided by ExtendedDataTable, column width resize, re-order column by drag-and-drop, clickable row, fix header when scrolling etc.

Hibernate first-level cache is going to consume a lot of memory. So I decided to clear the cache before performing search.

I also use ehcache for parameters and common codes caching.

There is an issue which has been solved less elegantly… when a transaction rollback happens, all entities will be detached (JPA spec). In order to save the user’s trouble to re-entery all inputs, I use entityManager.merge() to merge the detached entities into entityManager. While it works, this is not something recommended and I am not sure whether it will behave correctly in more complicated case.

In conclusion, learning Seam, JSF and JPA is not painful because of their user community, Google, documentation, books and open sources.


If everything go smoothly, I will start doing BPM with Drools Flow tomorrow…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: