struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Graham" <dgraham1...@hotmail.com>
Subject Re: Architecture advice....
Date Mon, 29 Jul 2002 18:59:16 GMT
Sounds like a "how to implement a facade" problem.  I would make your 
service layer a singleton with a factory method to retrieve the instance.  
That way you avoid the static method calls and maintain the symantics of 
passing messages to objects (the singleton).  You also avoid creating a new 
object everytime you want to use a service method.


>Hi,
>
>I had a discussion at work today concerning the best way to implement our
>application.  A very
>basic discription of the framework would be the following:
>
>1. Struts + Velocity for the view
>2. Struts ActionServlets for the controller
>3. Service layer/methods for querying persistence layer
>4. OJB persistence layer
>
>The main debate was actually about what the service layer would look like.
>We thought about the following options:
>
>1. The service layer consists of static methods
>2. The service layer would consists of normal classes
>3. The service layer could consist of servlets
>
>The idea is that (this is nothing new of course) the service layer would
>purely have methods such as addToShoppingBasket() or checkLogin(); 
>basically
>service methods which carry out the communication with the persistense 
>layer
>and returns the result to the controller.
>
>The question is though, should we create a new object every time we want to
>access a stateless method?  Surely that would be a bit of an overhead.  Go
>with servlets?  This possibly ties it to the web-container too much and
>isnīt very elegant (?).  Another option would be just to use static 
>methods;
>can this cause a problem when wanting to distribute to more than one 
>server?
>Is it better in terms of performance?
>
>I would really appreciate some help and ideas on this.  It would make 
>things
>easier in terms of deciding on the next step.
>
>Thanks in advance!
>
>Regards,
>
>Michael
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:struts-user-help@jakarta.apache.org>




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message