Re: [s2] Do I still need a business service layer ?

2007-04-18 Thread nicolas de loof

I fully agree with those architecture consideration.

What I see in struts2 is that I can use my business service as MVC controler
with no dependency on the web framework. My business service only has to
switch from a stateless-style (method with parameters) to a statefull or
command-style (properties for input / output + execution method).

If I write my business layer this way, I don't consider it to become part of
the wab layer, but it can be used directly by strut2 as an Action by
simply setting the expected properties in the valueStack and executing the
business method.

Am I wrong ?

2007/4/18, Ray Clough [EMAIL PROTECTED]:



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]




[s2] Do I still need a business service layer ?

2007-04-17 Thread nicolas de loof

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.


Re: [s2] Do I still need a business service layer ?

2007-04-17 Thread Mark Menard
On 4/17/07 10:20 AM, nicolas de loof [EMAIL PROTECTED] wrote:

 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 !

Hi Nico,

I guess you could do that, but I don't think I'd recommend it. It mixes up
control (your action) with business services (your service bean). Personally
I would keep them separate, and let each do what it is best at.

Mark

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



Re: [s2] Do I still need a business service layer ?

2007-04-17 Thread Ray Clough

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]