|an application prone to errors. JEE developers refer
this problem as the “XML hell”. This way of using
the XML files is popular among the whole Java
community as “the XML abuse”. Java
community made the successful attempts to
replace these XML files with the introduction of
the annotations to the Java source code.
To promote the use of annotations at enterprise
level officials of the Java standardization body
introduced EJB3. EJB3 provides the options to
use the annotations in place of the XML file
and expands the sphere of annotation-based
programming model for the web application.
It doesn’t mean that XML is fully useless, XML
best suits for specification of web application
page flows and can also define the work flow of
the business process. XML files enable a user
to centrally manage the work flow of the entire
web application rather than to scatter the
information around the Java source file.
7. Designed for Easy integration
Seam is mainly designed to simplify the
testing process. Unit testing is easier with seam
as all the Seam components are nothing but
the annotated POJO. Simply one need to create
the POJO instances which can be tested with
different testing frameworks such as TestNG
and JUnit. If there requires any interaction
between the Seam components then just create
the individual instances of those components
and manually establish the relationship between
Testing of the entire Seam application is a little
bit complex because it needs entire application
to run inside the Seam container. Seam comes
along with an embedded lightweight container
to handle the integrated testing. One can also
programmatically load the Seam container to
run the test into the test framework.
8. Designed for Stateful Web
Seam also designs stateful web applications
which are inherently multi-user. Today, most of
the business applications are stateful and
transactional. In case of
||Seam, all the components of an application are stateful
therefore it is quite easy to use seam for
managing states as compared to HTTP session.
Seam applications does not require a developer
to write the state management code, but simply
it, itself annotates the scope of the
components, lifecycle methods and other
stateful properties required. Stateful
components of Seam also manages the user
states in a better way in comparison to
conventional HTTP sessions.
Seam automatically ties up the transactions and
the database caches with the application state.
It temporarily holds database updates in
memory and commits updates to the database
while ending the conversation. For complex
stateful applications, in-memory cache reduces
the database load of the application.
Seam takes state management in web
applications a big step further by supporting
integration with the Open Source JBoss jBPM
business process engine. One can now specify
the work flows of different people in the
organization (i.e., customers, managers,
technical support etc.) and use the work flow
to drive the application, instead of relying on
the UI event handlers and databases.
9. Great Tools Support
Seam simplifies to accomplish difficult tasks
with JSF. Generally, to bookmark a JSF web
page and get it via HTTP GET is hard.
Generating a bookmarkable resultful web page
with Seam is quite simple. Seam makes the
JSF applications efficient by providing a number
of JSF tags and use of annotations increases
the “web friendliness”.
Simultaneously, Seam expands the web tier to
the business components and also expands
the EJB3 component model to POJOs. Even
though Seam also integrates a number of
commonly used other open source framework
like JBoss Portal, jBPM, JBossMicrocontainer,
JBoss Rules etc.
Although Seam is integrated with Java EE 5.0,
it doesn’t mean that it is limited to Java EE 5.0
servers. Seam applications can also be deployed
Oct 2007 | Java Jazz Up |29