[Opensource] Architectural Question

Peter A. J. Pilgrim peterp at xenonsoft.demon.co.uk
Mon Aug 19 17:07:29 PDT 2002


Innovest Ken wrote:
> hi mike,
> 
> In the middle of designing classes, using Expresso as
> the framework, please comment on the following
> architecture design:
> 
> (1)
> JSP--ExpressoController--MultiEntityBean--StoredProcedure
> (2)
> JSP--ExpressoController--SessionBean--MultiEntityBeans--StoredProcedure
> 

A Expresso Controller is a Struts Action subclass. This component is
strictly part of the front end. In other word an Expresso Controller
is part of the web tier.

If you are using an application server J2EE then you know that
EJB can live on different machine host and virtual machines.
Hence every EJB has a Remote interface, because the fundamental
mechanism of communication is RMI/IIOP.

In view there you would program with either (1) or (2) depending
on your needs. If you have shopping cart then it would normally be
a SessionBean which holds order items which would be entity beans. (2)

If you want to work one particular row in a database then obviously (1)
is fine. For example you want to print out employee records. It is
rare that you program a J2EE that talks only to entity beans.
You will normally have a session bean in there that has the
business methods.


> - Notice the difference between the 2 methods is
> Session Bean in method(2). Do we need to have a
> Session Bean to act as the facade to multiple Entity
> Beans? So that we can improve on scalability using
> Session EJB on Weblogic? Or ExpressoController in
> Method (1) is also good to handle scalability problem?
> If so, how it handles scalability, say if I form a
> cluster of weblogic servers?
> 

You can use Expresso in a J2EE application, but the default DBObject
needs to talk to a database. In other words your web tier, where
you run the Expresso Framework needs, access to database directly.

> The above question seems confusing, but the most
> important question is "Do we need to have a Session
> Bean between ExpressoController and Entity Session
> Bean"?
> 

I think you need see a good EJB book, like "Mastering EJB" by Ed Roman.
This book describes very well what session stateless and stateful
and entity beans are.

Expresso Framework is supposed to have a J2EE mapping / integration.
With this extra piece of software I think that you can program
with Expresso's own `DBObjects', and these will automatically
to EntityBean. A `DBObject' is theoretical a heavy duty
Data Transfer Hashmap object and so can be mapped to any reasonable
database table and therefore EntityBean.

The different between DBObjects and EntityBeans is that the J2EE spec
guarantees that any EJB ( both Session and Entity)

(1) has transparent access across different machines ( RMI/IIOP and JNDI )

(2) has container security ( deployment )

(3) has container life cycle management (ejbCreate() , ejbRemove() )

(4) can have guaranteed transaction management (JTA)


> - If we decide to use ExpressoController, how is it
> comparable to Session Bean, as in what features
> ExpressoController has, which Session Bean doesn't
> have and vice versa.
> 
> - And how does ExpressoController behaves like the
> stateful and stateless Session Bean? Does it use
> PersistentSession object?
> 

Expresso Controller is a Struts Action component subclass and therefore
by definition part of the web tier proper. You would use an Expresso
Controller to access a Session Bean. For more info look at
TheServerSide.com for Chuck Cavaness' preview book chapter
on ``EJB and Struts''.

> - We intend to user Stored procedure to improve the
> performance since we'll be sticking onto Oracle.
> 
> Hope to hear from u soon, Mike, any comments from you
> on the above design are welcome.
> 
> Thanks,
> Innovest
-- 
Peter Pilgrim         +-----\ +-++----++----+
Java Technologist     |     | | ||    ||    | 'n' Shine
                       |  O  | | ||  --+| ---+
         /\            | ._  / | | \  \ |    |
        /  \           | | \ \ | |+--  || ---+ A new day
       /_  _\  "Up"    | | | | | ||    ||    | is coming
         ||            +-+ +-+ +-++----++----+
<home page="http://www.xenonsoft.demon.co.uk/" />




More information about the Opensource mailing list