Share |
Introduction to Seam        
Print

Introduction to Seam

The traditional web application development in Java is usually handled using three tier architecture. The web layer is handled by one framework, the middle layer is handled by another framework and data access layer is handled by third framework. There are certain overlaps here like you can use Spring for web and middle layer and wither hibernate or JDBC or one of other ORM tools. or You can go for Struts as front layer, home grown middle layer and than one of ORM or JDBC tool as data access layer.

This kind of architecture has impedance when the flow moves from one framework to another. The context of three layers are separate so you have to move a lot of data back and forth. Also this has resulted in teams getting divided into similar roles. This division has resulted more because of lack of smooth flow in layers. In fact, if you look closely in these type of architectures, a lot of efforts goes into this and a lot of bug arises out of this. For example the famous LazyInitializationException in Hibernate is a classic example and it has given a lot of patterns based on the kind of frameworks employed in different layers.

Seam uses JSF and EJB3.0 and provides its own integration mechanism. What it means is that a EJB3.0 stateless bean can act as a JSF backing bean. Apart from EJB, Seam can make any POJO(external link) to act like a backing bean. In the case of POJO, Seam takes the responsibility of transactions, interception, threading and security. Also Seam provides Conversation and Business Process context in addition to Session and other context present in existing web applications. Seam uses Richfaces or Icefaces in the JSF layer which brings the AJAX feature automatically.

Seam derives its name from its ability to seam the front end and the back end layer together transparently.

To summarize,
  • If you have decided to go for JSF and EJB3.0 as your front end and back end layer than Seam will provide the glue for both the frameworks. Seam replaces JSF managed Bean container with a Seam container and also understands EJB. This results in a smooth transition from one framework another.
  • Seam can use POJO in place of EJB beans and even can use Spring beans.
  • Seam also has integration if you are working with other web frameworks like Wicket or Tapestry.

Seam comes with a tool called seam-gen which can help in setting applications very fast against a data model. These applications are complete in CRUD functionality.


Back To Java Home
Back To Home


Post new comment

Click for Help
BoldItalicUnderlineStrikethroughExternal LinkSmileys
Anti-Bot verification code: Random Image
Post new comment