-----Original Message-----
From: M`ris Orbid`ns [mailto:[EMAIL PROTECTED]] 
Sent: 22 November 2001 16:54
To: Struts-list (E-mail)
Subject: design question

Hello

I have several questions about design, "best practises":

1)  Where to store client's profile information (like login name) ?
session  or system state bean ?

Use the HttpSession. But be aware that you should put as little as possible
into the session. Large sessions do not work well in a cluster.

2)  How to create and use a system state bean ?

System state bean should be in scope "session", shouldnt it ?

Again put as little as possible in the session and avoid statefull session
beans. If you must put a bean in the session, make it as small as possible,
ideally it would just hold key info that can be used to request beans at
request level when needed. This is a trade off between performance and
scalability.

3) Where to put business logic (where I invoke JDBC) ?  
        Should business logic class be a bean ?

If you have an app server business logic should go into a stateless session
bean (BusinessService), which is invoked (via a BusinessDelegate) from a
struts Action class. If you are not using EJBs then the Action class should
still invoke a business delegate, but the delegate would simply create a
normal Java bean to act as the Business Service. The business service
(Stateless EJB or Java Bean) should delegate to another class to access a
datasource. If your are using EJBs this should be a CMP or BMP+DAO depending
on your app server (EJB 2 compliant consider CMP, else try CMP if supported
but be prepared to subclass to a BMP+DAO at a later date).

thanx in advance
Maris Orbidans
        

Jon Ridgway.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to