I would recommend using the DTOs: right now you are using a transaction for
each getXXX() you call (unless you changed the default transaction level
from required to supports or notSupported).
Using the DTOs limits the number of transactions to 1 versus n*m (n
UserAccounts * m getXXX() per UserAccount).
----
Peter Verkest






Ryan LeCompte <[EMAIL PROTECTED]>@JAVA.SUN.COM> on 10/10/2002 17:55:28

Please respond to Ryan LeCompte <[EMAIL PROTECTED]>

Sent by:    A mailing list for Enterprise JavaBeans development
       <[EMAIL PROTECTED]>


To:    [EMAIL PROTECTED]
cc:

Subject:    Exposing local entity beans to web tier?


Hello all,


I have a question concerning basic design issues with EJB and the JSP
presentation layer. Currently, I have designed a system using all local
component interfaces of EJB 2.0. I currently have the following
architecture
in place:

EJB --> Servlets (WebWork Actions) --> JSP

I'm utilizing the session facade design pattern where the business logic in
encapsulated in session beans, which internally access the entity beans,
etc. However, I am doing something of the following:

sessionBean.getUserAccounts() which returns a Collection of actual
UserAcountLocal's. I then am passing this collection off to the JSP just to
cycle through each entity bean and display the data via its getXXX()
methods. No modifications to the entity beans are being done directly in
the
Actions/JSPs, rather they are modified through methods of the session
beans.
Now I know that there is the concept of DTO (Data transfer objects), which
send the data from the particular entity bean to a regular java bean for
presentation. I know that DTO's increase performance if one is using remote
interfaces, because there is less network traffic that occurs via that
transport method. However, I know that WebLogic performs excellent caching
of entity beans, so that multiple invocations of get() methods on entity
beans will not make a trip to the database each and every time the get()
method is called. So, my question is: Is it "safe" to continue with the
current way I am designing/coding the system? I just find it a bit tedious
to create value objects for each and every entity bean, if I know that I
will not be calling setXXX() methods from within the presentation layer.
Also, with EJB 2.0 and the introduction of local component interfaces, it
seems that issues regarding limiting the amount of network traffic don't
seem to be so relevant. Any suggestions/tips are appreciated. :-)

Best regards,

Ryan LeCompte [EMAIL PROTECTED] http://www.louisiana.edu/~rml7669

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to