You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joe Yuen <jo...@chisq.com> on 2007/12/21 22:12:17 UTC

struts 2 vs struts 1+spring

I have an application that currently is implemented using struts 1.2.8 + spring 1.2.8 + hibernate. What would be the advantages to migrate this to a struts 2 + hibernate solution?

Re: struts 2 vs struts 1+spring

Posted by Ted Husted <hu...@apache.org>.
On Dec 22, 2007 3:57 PM, Joe Yuen <jo...@chisq.com> wrote:
> Thank you. It's nice to get a gracious, useful answer. I am not familiar with Struts 2 yet but
>am trying to learn as much as I can.
>
> Is it possible to run both Struts 1 and 2 together so that I can do the migration slowly rather
>than all at once?
>than all at once?

Yes. A good place to start is by reviewing the articles in the
"Adoption and Migration" section of  "Other Resources" .

 * http://struts.apache.org/2.x/docs/home.html#Home-AdoptionandMigration

-- HTH, Ted
 * <http://www.StrutsMentor.com/>

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


RE: struts 2 vs struts 1+spring

Posted by Joe Yuen <jo...@chisq.com>.
Thank you. It's nice to get a gracious, useful answer. I am not familiar with Struts 2 yet but am trying to learn as much as I can. 
 
Is it possible to run both Struts 1 and 2 together so that I can do the migration slowly rather than all at once?
 
 

________________________________

From: ted.husted@gmail.com on behalf of Ted Husted
Sent: Sat 12/22/2007 6:20 AM
To: Struts Users Mailing List
Subject: Re: struts 2 vs struts 1+spring



On Dec 22, 2007 2:21 AM, Joe Yuen <jo...@chisq.com> wrote:
> Thanks that was a good analogy. I have used Spring and and I like it but then let me turn the
> question around, what do we gain by adding Struts 2 to be used with Spring?

Spring MVC is a capable framework, and I wouldn't hesitate to use it
myself -- if that's what everyone else on my team wanted to use. The
same goes for Tapestry, Wicket, Stripes, Click, and even ASP.NET.

Struts 2 does brings a number of goodies to the table, including an
elegant, extensible architecture and a kickass tag library. But, for
my money, our greatest asset is the Struts user community. In
particular, our ability to ask questions like this on the list, and
receive gracious, useful answers.

To mangle an old saying: "It's not the nut, it's the nuts behind the wheel."

-- HTH, Ted
 * <http://www.StrutsMentor.com/>

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





Re: struts 2 vs struts 1+spring

Posted by Ted Husted <hu...@apache.org>.
On Dec 22, 2007 2:21 AM, Joe Yuen <jo...@chisq.com> wrote:
> Thanks that was a good analogy. I have used Spring and and I like it but then let me turn the
> question around, what do we gain by adding Struts 2 to be used with Spring?

Spring MVC is a capable framework, and I wouldn't hesitate to use it
myself -- if that's what everyone else on my team wanted to use. The
same goes for Tapestry, Wicket, Stripes, Click, and even ASP.NET.

Struts 2 does brings a number of goodies to the table, including an
elegant, extensible architecture and a kickass tag library. But, for
my money, our greatest asset is the Struts user community. In
particular, our ability to ask questions like this on the list, and
receive gracious, useful answers.

To mangle an old saying: "It's not the nut, it's the nuts behind the wheel."

-- HTH, Ted
 * <http://www.StrutsMentor.com/>

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


RE: struts 2 vs struts 1+spring

Posted by Joe Yuen <jo...@chisq.com>.
 
Thanks that was a good analogy. I have used Spring and and I like it but then let me turn the question around, what do we gain by adding Struts 2 to be used with Spring?
 
-Joe

________________________________

From: Gary Affonso [mailto:glists2@greywether.com]
Sent: Fri 12/21/2007 8:27 PM
To: Struts Users Mailing List
Subject: Re: struts 2 vs struts 1+spring



Joe Yuen wrote:
> Well, that's kind of the essence of the question. What would you
> loose if you did? It seems to me that there is quite a bit over
> overlap  to Struts2 and Spring.

I guess it depends on the app.  In most spring apps I've worked with
losing Spring is sort of like losing the hub of a wagon-wheel and a
bunch of the spokes.  It aint gonna roll far, it certainly aint gonna
take any weight.

But maybe you inherited your app so you don't understand the value of
Spring?  In that case definitely go climb the curve.  Or at least read
some articles about why it's so cool.  This list is probably not the
place to get a Spring education.

Or maybe you have an app where the use of Spring was just overkill?
This happens.  Spring comes with some complexity of its own and that
complexity is completely unnecessary for very simple webapps (like a
single form processing servlet).  So if your app is very simple then
Spring may, indeed, by buying you nothing but unnecessary headaches.

Or maybe you're confusing Spring MVC (a small *portion* of the Spring
framework) with Spring as a whole?  Spring MVC does directly compete
with S2 and other webapp frameworks.  I don't use it, I don't recommend
it.  But Spring MVC is a small portion of the whole framework and very
easy to ignore.  The other 85% should leave you with a very good feeling
in your pants.

Or maybe you're just using Spring for one little thing (like an smtp
library) and nothing else?  I've seen this, too.  Spring is like a
buffet.  You can take what you want and you can pretty much ignore
everything else.  You just want the pudding?  Just eat the pudding.

But it's when you fill your plate with some of each dish that Spring
really shines.  Each dish perfectly compliments another and the sum
really is more than the parts.

But even if you are just eating some pudding, even that alone might be
reason enough to keep Spring.  Spring has some great tasting pudding.

- Gary

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





Re: struts 2 vs struts 1+spring

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
>
>
> Or maybe you're just using Spring for one little thing (like an smtp 
> library) and nothing else?  I've seen this, too.  Spring is like a 
> buffet.  You can take what you want and you can pretty much ignore 
> everything else.  You just want the pudding?  Just eat the pudding.
>
> But it's when you fill your plate with some of each dish that Spring 
> really shines.  Each dish perfectly compliments another and the sum 
> really is more than the parts.
>
> But even if you are just eating some pudding, even that alone might be 
> reason enough to keep Spring.  Spring has some great tasting pudding.
Great analogy! :-)

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


Re: struts 2 vs struts 1+spring

Posted by Gary Affonso <gl...@greywether.com>.
Joe Yuen wrote:
> Well, that's kind of the essence of the question. What would you
> loose if you did? It seems to me that there is quite a bit over
> overlap  to Struts2 and Spring.

I guess it depends on the app.  In most spring apps I've worked with 
losing Spring is sort of like losing the hub of a wagon-wheel and a 
bunch of the spokes.  It aint gonna roll far, it certainly aint gonna 
take any weight.

But maybe you inherited your app so you don't understand the value of 
Spring?  In that case definitely go climb the curve.  Or at least read 
some articles about why it's so cool.  This list is probably not the 
place to get a Spring education.

Or maybe you have an app where the use of Spring was just overkill? 
This happens.  Spring comes with some complexity of its own and that 
complexity is completely unnecessary for very simple webapps (like a 
single form processing servlet).  So if your app is very simple then 
Spring may, indeed, by buying you nothing but unnecessary headaches.

Or maybe you're confusing Spring MVC (a small *portion* of the Spring 
framework) with Spring as a whole?  Spring MVC does directly compete 
with S2 and other webapp frameworks.  I don't use it, I don't recommend 
it.  But Spring MVC is a small portion of the whole framework and very 
easy to ignore.  The other 85% should leave you with a very good feeling 
in your pants.

Or maybe you're just using Spring for one little thing (like an smtp 
library) and nothing else?  I've seen this, too.  Spring is like a 
buffet.  You can take what you want and you can pretty much ignore 
everything else.  You just want the pudding?  Just eat the pudding.

But it's when you fill your plate with some of each dish that Spring 
really shines.  Each dish perfectly compliments another and the sum 
really is more than the parts.

But even if you are just eating some pudding, even that alone might be 
reason enough to keep Spring.  Spring has some great tasting pudding.

- Gary

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


Re: struts 2 vs struts 1+spring

Posted by Ted Husted <hu...@apache.org>.
On Dec 21, 2007 9:23 PM, Alberto A. Flores <aa...@gmail.com> wrote:
> If you are following the typical scenario, here are some of the things
> you would lose (that no Struts release will do):
>
> - Transaction Management (if you are using Spring for this)
> - AOP support
> - Dependency Injection
> - JNDI lookups
> - Scalable security
> - Simple programming model

The original question was Struts2 + Hibernate (or JPA). Not every
application needs to scale, and in fact probably 80-90% of web
applications have a predefined number of intranet users. Most of these
applications may not need AOP, JNDI, scalable security, or transaction
management beyond "never mind" rollback.

For many applications, dependency application could be handled by a
custom interceptor, which may be a simpler programming model, if you
don't need the rest of what Spring offers.

I'm not trying to criticizing Spring. I'm just trying to point out
that we should try to distinguish between small-scale and larger-scale
application, and choose the best tool for the job at hand.

-- HTH, Ted
* <http://www.StrutsMentor.com/>

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


Re: struts 2 vs struts 1+spring

Posted by "Alberto A. Flores" <aa...@gmail.com>.
This sounds like you need to ask this question in the Spring Forum, not 
here. If you don't understand the value of Spring in your current app, 
go ahead and try. Hopefully that will be illustrative. I can assure that 
some of the things you will lose (if you are using at all) are not 
provided in Struts (MVC) and Hibernate (persistence).

If you are following the typical scenario, here are some of the things 
you would lose (that no Struts release will do):

- Transaction Management (if you are using Spring for this)
- AOP support
- Dependency Injection
- JNDI lookups
- Scalable security
- Simple programming model

I'm sure some other people can add more of their own. You must not 
forget that at the end of the day, these are tools. You are welcome to 
write you own version at your own expense :)


Joe Yuen wrote:
> Well, that's kind of the essence of the question. What would you loose if you did? It seems to me that there is quite a bit over overlap  to Struts2 and Spring.
> 
> ________________________________
> 
> From: Gary Affonso [mailto:glists2@greywether.com]
> Sent: Fri 12/21/2007 1:51 PM
> To: Struts Users Mailing List
> Subject: Re: struts 2 vs struts 1+spring
> 
> 
> 
> Joe Yuen wrote:
>> I have an application that currently is implemented using struts
>> 1.2.8  + spring 1.2.8 + hibernate. What would be the advantages to migrate this
>  > to a struts 2 + hibernate solution?
> 
> Er, huh?
> 
> In my experience it's *spring* that sits at the core of an app.  That's
> the thing that doesn't go away.
> 
> The web-framework (s1, webwork, s2, jsf, wicket), the persistence
> technology (hibernate, jpa backed with hibernate, ibatis, etc.) should
> all sort of orbit around the spring core, swapping in a new
> web-framework should be way easier if you keep your spring core around.
> 
> Why would you cut Spring out of the mix when you move to S2?
> 
> - Gary
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org

-- 

Alberto A. Flores
http://www.linkedin.com/in/aflores



Re: struts 2 vs struts 1+spring

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Joe Yuen wrote:
> Well, that's kind of the essence of the question. What would you loose if you did? It seems to me that there is quite a bit over overlap  to Struts2 and Spring.
>   
No, there's no significant overlap between Struts2 and Spring (except 
spring-mvc of course)

I'm not sure how to arrived at that conclusion, perhaps it was because 
you saw that the Struts2 architecture uses an ObjectFactory and 
Interceptors.
Struts2 can use any ObjectFactory implementation.  It does include a 
default implementation but that's only used internally (eg. it will 
create your actions but can't DI arbitrary objects into them).
The Spring plugin provides Spring as the ObjectFactory
The Guice plugin provide Guice as the ObjectFactory

The Struts2 interceptors are in no way related to Spring/AOP 
interceptors.  They're for intercepting requests to actions only.

So in answer to your question, if you don't use Spring you'' lose all 
the features of Spring.  If you don't use any specific features of 
Spring then you don't need it.

Hope that helps,
 Jeromy Evans



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


RE: struts 2 vs struts 1+spring

Posted by Joe Yuen <jo...@chisq.com>.
Well, that's kind of the essence of the question. What would you loose if you did? It seems to me that there is quite a bit over overlap  to Struts2 and Spring.

________________________________

From: Gary Affonso [mailto:glists2@greywether.com]
Sent: Fri 12/21/2007 1:51 PM
To: Struts Users Mailing List
Subject: Re: struts 2 vs struts 1+spring



Joe Yuen wrote:
> I have an application that currently is implemented using struts
> 1.2.8  + spring 1.2.8 + hibernate. What would be the advantages to migrate this
 > to a struts 2 + hibernate solution?

Er, huh?

In my experience it's *spring* that sits at the core of an app.  That's
the thing that doesn't go away.

The web-framework (s1, webwork, s2, jsf, wicket), the persistence
technology (hibernate, jpa backed with hibernate, ibatis, etc.) should
all sort of orbit around the spring core, swapping in a new
web-framework should be way easier if you keep your spring core around.

Why would you cut Spring out of the mix when you move to S2?

- Gary

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





Re: struts 2 vs struts 1+spring

Posted by Gary Affonso <gl...@greywether.com>.
Joe Yuen wrote:
> I have an application that currently is implemented using struts
> 1.2.8  + spring 1.2.8 + hibernate. What would be the advantages to migrate this
 > to a struts 2 + hibernate solution?

Er, huh?

In my experience it's *spring* that sits at the core of an app.  That's 
the thing that doesn't go away.

The web-framework (s1, webwork, s2, jsf, wicket), the persistence 
technology (hibernate, jpa backed with hibernate, ibatis, etc.) should 
all sort of orbit around the spring core, swapping in a new 
web-framework should be way easier if you keep your spring core around.

Why would you cut Spring out of the mix when you move to S2?

- Gary

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


Re: struts 2 vs struts 1+spring

Posted by Ted Husted <hu...@apache.org>.
On Dec 21, 2007 4:12 PM, Joe Yuen <jo...@chisq.com> wrote:
> I have an application that currently is implemented using struts 1.2.8 + spring 1.2.8 +
> hibernate. What would be the advantages to migrate this to a struts 2 + hibernate solution?

The Spring integration in Struts 2 is simpler to set up (just drop in
the plugin), but if the application is already up and running, I'm not
sure if it would make a difference that made a difference.

-- HTH, Ted
 * <http://www.StrutsMentor.com/>

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