Monday, August 2, 2010

JBoss Seam performance

Hey, 
long time I was not here, but I had a lot of work. Over the last two years, I created applications on the JBoss Seam framework and Liferay PortalNeedless to say that both are powerful machines. Today I say a little bit about Seam and Liferay for a few days. This article is for people who are already doing something in the Seam. Probably, if you did you do something advanced in the JSF, which is standard in the Seam 2.0, you noticed that in certain situation rendering of the page takes a long time.Overall, JBoss Seam is a very thought, component frameworks, however, it is important to skillfully use their benefits.Below are a few rules that I managed to get out of the created projects.

  1. Do not place in the methods getters and setters of any logic, because these methods are repeatedly invoked in the page of generations. Imagine the situation that you have a loop that iterates over a million times and something counts. If you put it in getters, call this loop several times. In Seam such invokes are most common forms generated by JBoss Tools. For example, a form list presenting the results of a database. Once getter is called to download the collection, once to check whether it is empty, etc.
  2. Avoid creating bi-directional relationships in entity classes, because it will further slow the Seam. Seam uses HibernateMore efficient is to write additional query rather than creating a bi-directional relationship.
  3. If you do not have advanced tables, you shoul use <h:table>  instead of <rich:table>. This will speed up the rendering of the page.
  4. Use the defined scope of component( Application, Conversation, Session etc.). This will reduce memory used.
  5. If you are creating a small project, do not need advanced tools for Java EE, EJB components offered, create Seam project as an war archive.You will need much less resources application server, and additionally you can run the project on Tomcat.

No comments:

Post a Comment