1 Reply Latest reply on May 5, 2009 7:12 PM by gonorrhea

    Will SEAM framework support seperation of web and Appl Tier deployment on two different physcial machines??

      Hi


      we are planning to develope applications using SEAM Framework. but we have the following requirements.


      0. There should be clear-cut seperation of web(war) and ejb(ejb-jar) components and need to deploy on two different physical machines.
      1. All our web applications should run on web container
      2. All EJB Appl run on Application container.


      Is it easy to achieve these things with help of SEAM framework??


      and also I have following queries.


      1. what is the use of org.jboss.seam.framework.EntityQuery and org.jboss.seam.framework.EntityHome?
      2. when I generate entities from seam-gen, i got classes which extends from EntityQuery and  EntityHome?? Can anyone give explanation about it? what is the use of it over the normal using of @local @Remote Interfaces with SFSB and SLSB?


      3. Please explain the difference between the EJB SFSB,SLSB Vs Classes which extends from EntityQuery and EntityHome??


      Thanks.

        • 1. Re: Will SEAM framework support seperation of web and Appl Tier deployment on two different physcial machines??
          gonorrhea

          Seam is an integration framework that bridges and improves upon JSF and EJB3.  As far as physical architecture of your environment/servers, you need to decide whether or not it will be a clustered envmt.


          If you're using JBoss AS, you should be able to use Tomcat (JBoss Web) as servlet container (and possibly as the web server if you're not using Apache httpd or IIS to serve up the static content) on one machine and EJB container on the other machine.  I think the advantage may be for security reasons (e.g., firewalls) to split the tiers like that.  Otherwise, co-locating the servlet container and EJB container on the same machine is typical and easier.  Seam apps can be deployed in either scenario.  Read the Mastering EJB 3 book for more info on this.


          Keep in mind that when you do split the web and ejb tiers, calls to ejb components from your web tier will require remote interfaces for your EJB components b/c you're calling from one process (JVM) to another process over the wire.  So from a performance perspective, you're probably better off with a co-located setup.


          The Seam framework ships with what's called Seam Application Framework or SAF.  This is a library/API that contains the EntityQuery and EntityHome classes, etc.  There are some benefits to using SAF for your projects but it is difficult to understand and use (for me anyways).  I've heard from JBoss tech support that approx. half of their Seam customers use SAF for their projects.  I personally don't like it but I'm sure others prefer it.


          from Yuan et al book, section 16.2:



          Seam provides an application framework with built-in generic DAO components.  You can develop simple CRUD web applications in Seam without writing a single line of business logic code.

          You can literally write global queries in components.xml similar to NamedQuery in JPA/Hibernate.  These queries are used directly in a JSF page, for example.


          <fwk:entity-query name="customers"
                entity-manager="#{entityManager}
                ejbql="select c from Customer c"/>



          Seam does not enforce any extra layering like DAO, etc. that you typically see with Spring/Hibernate or Struts/EJB2.x.  DAO layer in Seam is optional.


          I'm not sure if SAF supports atomic conversations like you can achieve using SMPC and Hibernate MANUAL flush (commit all entity changes on submit method only).  This would be a disadvantage of using SAF.


          A very good intro to the SAF is chapter 16 in the Yuan et al book.