I currently try to design the Business Tier of my Struts application I am
thus very interested by this subject.
 
We also chose to use business delegate classes (one by doamin)that will be
called by the Action classes. 
The business delegate classes communicate with the remote Application Server
Tier. 
These classes create or update JavaBeans objects with ApplicationServer
data.
The JavaBeans are stored in the HttpSession or in the ServletContext.

We thought of defining the business delegate class with a
GetSingleInstance()
method and the initialization of the instance will be done in the
contextInitialized() method of our ServletContextListener class. 
I am not sure that the use of the Singleton pattern is the best way to do.

What do you think about that ?


----------------------------------------------------------- 
As of February 12, 2003 Thomson unifies its email addresses on a worldwide
basis.Please note my new email address: [EMAIL PROTECTED] 

Thomson is the leader in solutions and technologies for the entertainment
and media industries and serves its customers under its four strategic
brands: Technicolor, Grass Valley, RCA and THOMSON. 
More about Thomson: http://www.thomson.net/videochain 

----Original Message-----
From: Peter F. [mailto:[EMAIL PROTECTED]]
Sent: 20 February 2003 10:13
To: Struts Users Mailing List; Puneet Agarwal
Subject: Re[2]: What is the best architecture solution ???


Hello Puneet,


Well, I agree with you. But I'm interesting in another question.
For example, I will have a Business Delegate pattern, i.e. my Struts
action will "know" that there's an object - say MyServicesObject -
with some methods. And action should call one of this methods
to get some business data and pass them into JSP-page.

The question is:
when and how in my Struts-application (without EJB) should I
create an instance of MyServicesObject and how should I get a
reference to one in action ??

It seems one way is to use standard Factory+Singleton pattern.
Is it quite correct ?? Or probably there're more flexible decisions?




Thursday, February 20, 2003, 12:52:04 PM, you wrote:

PA> Peter,
PA> Its not a very good practice to access the database access objects (DAO)
PA> directly from your action class.(Ref: Design Patterns)

PA> As far I understand you want to obtain the reference from the point of
view
PA> of drawing the objects from object pool, or is it you are aiming at
getting
PA> the class name also from some memory area.
PA> In case you are looking for obtaining it from Object pool, it will
actually
PA> depend on the app server, not on struts.

PA> Regards
PA> Puneet


PA> ----- Original Message -----
PA> From: "Chetan Sahasrabudhe" <[EMAIL PROTECTED]>
PA> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; "Peter
F."
PA> <[EMAIL PROTECTED]>
PA> Sent: Thursday, February 20, 2003 9:23 AM
PA> Subject: Re: What is the best architecture solution ???


>> Hi Peter,
>>
>>     I am not sure if u r into EJB or just want to define beans for ur
>> Business and DB framework.
>> You will have to use one action class which is linked through
PA> ActionServlet.
>>
>> through this action class instatiate your business layer
>> and i guess business layer classes will have connectivity to DB in normal
>> thin client connection.
>>
>> or else you can instantiate your DB classes in action method and then use
PA> it
>> to passon to business logic layer.
>>
>> Regards
>> Chetan
>> ----- Original Message -----
>> From: "Peter F." <[EMAIL PROTECTED]>
>> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>> Sent: Thursday, February 20, 2003 1:25 PM
>> Subject: What is the best architecture solution ???
>>
>>
>> > Hello All,
>> >
>> > Could anyone explain me, what is the best (or just good) way to make
>> > communication between:
>> >  Struts Actions <-> Business Logic Layer <-> DB Source
>> >
>> >  I want to have separate layers for Business logic and DB Access.
>> >  But the main question - how should I get the reference to Business
PA> Layer
>> >  classes from actions and how should I get the reference to DataSource
>> >  from Business layer classes.
>> >
>> >  What is the most flexible approach ??
>> >
>> >
>> > --
>> > Best regards,
>> >  Peter                          mailto:[EMAIL PROTECTED]
>> >
>> >
-- 
Best regards,
 Peter                            mailto:[EMAIL PROTECTED]


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

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

Reply via email to