You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Access Denied <ac...@gmail.com> on 2005/07/08 16:32:06 UTC

Spring

hi alls,

I've been reading about the Spring framework at
www.springframework.org and I am wondering what the advantage, if any,
is over struts?  Has/does anybody use Spring and how does it compare
to Struts?

tia,
buddy

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


Re: Spring

Posted by Michael Jouravlev <jm...@gmail.com>.
On 7/8/05, Access Denied <ac...@gmail.com> wrote:
> It seems like the Web Flow subproject of spring is pretty cool,
> especially for the age-old problem of the <back> button.
> 
> buddy

Buddy, last time I checked, the best Spring Web Flow could do about
Back button is to inform you that you broke the flow by submitting
stale page. It did not prevent you from going back and seeing that
stale page.

Struts Dialogs has WizardAction (not advertised yet, cause I have not
written good docs on it), which makes things much easier on user and
less error-prone:
http://www.superinterface.com/strutsdialog/wizardaction.do  (you are
not signing up for anything, this is just a demo).

What you get:
* Wizard state is stored completely on server, no hidden fields.
* Wizard state always depends on domain model state.
* Wizard view is always synchronized with wizard state.
* Wizard state is an object, and contains model data or refers to it.
* Wizard transition is an object, and can validate itself, taking into
account domain model standing.
* Back, Forward and Refresh buttons are safe to use.
* Error messages are not lost on page refresh.
* A wizard can be reconfigured in runtime.
* Wizard rules are defined completely in Java, no XML configuration
files, no server-side Javascript.
* Wizard rules and domain model integration can be tested using base
JDK classes only, without user interaction.
* Can be used as a component.

You can also check this one:
http://www.superinterface.com/wizard/signupWizard.do
It combines both signup wizard and login control in one easy to use component. 

I need some time to clean things up. Also, I decided that the simplest
way to pursue people to use your stuff is to give them something that
they can use in their projects right away. So, I am going to redesign
my samples, making a real drop-right-in-the-page components out of
them.

Michael.

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


Re: Spring

Posted by Joe Germuska <Jo...@Germuska.com>.
At 12:14 PM -0400 7/8/05, Access Denied wrote:
>It seems like the Web Flow subproject of spring is pretty cool,
>especially for the age-old problem of the <back> button.

Yes, I thought it looked pretty cool as well; note however that I 
found it impossible to find a way to implement that in a Struts 
application.  They provide a basic Struts Action class which is meant 
to help, but it really doesn't play nicely with common Struts 
approaches to form validation and display.  If you choose to use 
Spring WebFlow in a Struts app, you will have to develop a pretty 
good understanding of Spring's model for validation and page display; 
I ultimately decided that I didn't want my application to have two 
substantially different approaches to the same thing, and implemented 
my own simpler webflow mechanism which fit better with the rest of 
the Struts app.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

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


Re: Spring

Posted by Access Denied <ac...@gmail.com>.
It seems like the Web Flow subproject of spring is pretty cool,
especially for the age-old problem of the <back> button.

buddy

On 7/8/05, Joe Germuska <Jo...@germuska.com> wrote:
> At 9:24 AM -0600 7/8/05, netsql wrote:
> >David Whipple wrote:
> >>We use it for the primarily for application assembly and integration with
> >>iBATIS.
> >>
> >
> >
> >The rap on Spring is that it's a bit more complicated than Struts.
> >It does have a dao interfcace, and... Struts does not.
> >A big benefit is that you can switch from EJB to something else.
> >
> >Imo, Commons chain can be used for application assembly (and dao:
> >execute(map))
> 
> I guess I don't understand this.  commons-chain is a run-time process
> (hence the API method "execute").  I suppose you're saying that you
> can set properties on your commands, and thus have an assembled
> application?  But the Digester-based process for instantiating chains
> which is provided with commons-chain is extremely limiting for
> configuring business/service objects.  (It's entirely possible to
> construct commons chains with Spring, actually, but I don't think
> that is what Vic has in mind...)
> 
> Alternatively, you could consider population of the chain Context to
> be roughly "application assembly" -- but the commons-chain library
> doesn't really provide much support for setting up a complicated
> Context.
> 
> >I do wish Struts/Shale/Jakarta/Sun had an unimplemented Dao interface.
> 
> Hm.  What would this look like?  Is it just a marker?  The way I
> write my DAOs, there would never really be any useful commonality
> which could be extracted into an interface.
> 
> Or are you talking about just the general persistence support that
> Spring provides?
> 
> Note that you can use Spring's persistence pieces (both its own
> mapping framework as well as adapters to make IBATIS and Hibernate a
> bit easier to use) without using Spring MVC.
> 
> For application assembly, Spring is not complicated at all; the basic
> XML syntax for instantiating beans and relating them to each other is
> about as simple can be, although it can get a bit verbose sometimes.
> 
> For Spring MVC, I can't really compare the complexity, because I've
> used it so little.  I found some things confusing, but it's hard for
> me to tell how much of that is because I have Struts ingrained so
> deeply in my brain. Also, I skipped right past Spring's basic MVC to
> trying to use the recently released WebFlow package, and trying to
> use it integrated with Struts, rather than just trying to build
> something from scratch within its own environment.
> 
> Joe
> 
> --
> Joe Germuska
> Joe@Germuska.com
> http://blog.germuska.com
> "Narrow minds are weapons made for mass destruction"  -The Ex
> 
> ---------------------------------------------------------------------
> 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


Re: Spring

Posted by netsql <ne...@roomity.com>.
> Alternatively, you could consider population of the chain Context to be 
> roughly "application assembly" -- but the commons-chain library doesn't 
> really provide much support for setting up a complicated Context.
> 

I know, but even digester lets me assemble objects. And hivemind.


>> I do wish Struts/Shale/Jakarta/Sun had an unimplemented Dao interfac
> 
> Hm.  What would this look like?  Is it just a marker?  The way I write 
> my DAOs, there would never really be any useful commonality which could 
> be extracted into an interface.
> 

The fact that there is an interface is key.
Then I can change from EJB to iBatis to xyz.

ex:
ArrayList populate(Map args)
boolean insert(Map row)

etc.

.V


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


Re: Spring

Posted by Joe Germuska <Jo...@Germuska.com>.
At 9:24 AM -0600 7/8/05, netsql wrote:
>David Whipple wrote:
>>We use it for the primarily for application assembly and integration with
>>iBATIS.
>>
>
>
>The rap on Spring is that it's a bit more complicated than Struts. 
>It does have a dao interfcace, and... Struts does not.
>A big benefit is that you can switch from EJB to something else.
>
>Imo, Commons chain can be used for application assembly (and dao: 
>execute(map))

I guess I don't understand this.  commons-chain is a run-time process 
(hence the API method "execute").  I suppose you're saying that you 
can set properties on your commands, and thus have an assembled 
application?  But the Digester-based process for instantiating chains 
which is provided with commons-chain is extremely limiting for 
configuring business/service objects.  (It's entirely possible to 
construct commons chains with Spring, actually, but I don't think 
that is what Vic has in mind...)

Alternatively, you could consider population of the chain Context to 
be roughly "application assembly" -- but the commons-chain library 
doesn't really provide much support for setting up a complicated 
Context.

>I do wish Struts/Shale/Jakarta/Sun had an unimplemented Dao interface.

Hm.  What would this look like?  Is it just a marker?  The way I 
write my DAOs, there would never really be any useful commonality 
which could be extracted into an interface.

Or are you talking about just the general persistence support that 
Spring provides?

Note that you can use Spring's persistence pieces (both its own 
mapping framework as well as adapters to make IBATIS and Hibernate a 
bit easier to use) without using Spring MVC.

For application assembly, Spring is not complicated at all; the basic 
XML syntax for instantiating beans and relating them to each other is 
about as simple can be, although it can get a bit verbose sometimes.

For Spring MVC, I can't really compare the complexity, because I've 
used it so little.  I found some things confusing, but it's hard for 
me to tell how much of that is because I have Struts ingrained so 
deeply in my brain. Also, I skipped right past Spring's basic MVC to 
trying to use the recently released WebFlow package, and trying to 
use it integrated with Struts, rather than just trying to build 
something from scratch within its own environment.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

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


Re: Spring

Posted by netsql <ne...@roomity.com>.
David Whipple wrote:
> We use it for the primarily for application assembly and integration with
> iBATIS.
> 
> 


The rap on Spring is that it's a bit more complicated than Struts. It 
does have a dao interfcace, and... Struts does not.
A big benefit is that you can switch from EJB to something else.

Imo, Commons chain can be used for application assembly (and dao: 
execute(map))

I do wish Struts/Shale/Jakarta/Sun had an unimplemented Dao interface.

.V


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


Re: Spring

Posted by David Whipple <dw...@dtcc.com>.
We use Spring as well, but also not for the MVC portions (we use struts).
We use it for the primarily for application assembly and integration with
iBATIS.

The AOP  support seems very interesting, but at this point we are only
using that w.r.t transactions.  I am thinking about incorporating it into
some sort of audit capabilities.

I am very fond of it.

Dave



                                                                           
             Joe Germuska                                                  
             <Joe@Germuska.com                                             
             >                                                          To 
                                       Access Denied                       
             07/08/2005 10:39          <ac...@gmail.com>,          
             AM                        user@struts.apache.org              
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
               "Struts Users           Re: Spring                          
               Mailing List"                                               
             <user@struts.apac                                             
                  he.org>                                                  
                                                                           
                                                                           
                                                                           




At 10:32 AM -0400 7/8/05, Access Denied wrote:
>hi alls,
>
>I've been reading about the Spring framework at
>www.springframework.org and I am wondering what the advantage, if any,
>is over struts?  Has/does anybody use Spring and how does it compare
>to Struts?

I use Spring avidly as an application assembly strategy.  I use it
with Struts, and in the way I use it, it doesn't compare to Struts at
all.

Spring does include a Web MVC toolkit.  I have only passing
familiarity with it.  There are some elegant things about its design,
but it doesn't really fit with how I build webapps, and Spring is
very much designed so that you can take what you like without having
to use the whole thing.

Joe

--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
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


Re: Spring

Posted by Joe Germuska <Jo...@Germuska.com>.
At 10:32 AM -0400 7/8/05, Access Denied wrote:
>hi alls,
>
>I've been reading about the Spring framework at
>www.springframework.org and I am wondering what the advantage, if any,
>is over struts?  Has/does anybody use Spring and how does it compare
>to Struts?

I use Spring avidly as an application assembly strategy.  I use it 
with Struts, and in the way I use it, it doesn't compare to Struts at 
all.

Spring does include a Web MVC toolkit.  I have only passing 
familiarity with it.  There are some elegant things about its design, 
but it doesn't really fit with how I build webapps, and Spring is 
very much designed so that you can take what you like without having 
to use the whole thing.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

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