Architecture is architecture, regardless of whether it is Struts-1, Struts-2,
or something else.  A Service Layer has the benefits of giving clear
separation of function between the Controller (Struts) and the Application. 
The web framework (here Struts) is primarily a vehicle for delivering data
back and forth between the Application and the user.  The application should
be independent of the framework.  The Service Layer is really the API for
your application.  Without using a Service Layer, you tend to get lots of
Business Logic in the Action classes, which will tie your application not
only to the framework, but to the type of delivery platform (eg a Web App),
which will prevent you from later making a Swing app or something else out
of it if you want to.

- Ray Clough



nicolas de loof-2 wrote:
> 
> Hello,
> 
> I've used struts1 for several years and I'm now looking at Struts².
> 
> In struts1, to create a "registerUser" use-case I need a RegisterAction, a
> RegistrationService and some business code.
> My struts1 RegistrationService is only used to start a transaction using
> Spring @Transactional annotation. Hibernate does all the required job.
> 
> In struts2, AFAIK I can use any POJO as controler. Can I use my (maybe
> adapted) RegistrationService as a Controller by simply changing to a
> statefull model (user to register is not a method parameter anymore but a
> bean property) ? This would make things really simplier !
> 
> Nico.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-s2--Do-I-still-need-a-business-service-layer---tf3591059.html#a10051941
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to