File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Spring live book - Performance issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Spring live book - Performance issue" Watch "Spring live book - Performance issue" New topic
Author

Spring live book - Performance issue

Alvin chew
Ranch Hand

Joined: Jan 08, 2004
Posts: 834
hi, Matt Raible , as compare to other MVC framework like struts, jsf .. how spring perform as compare among other framework in term of speed and stability ..thank you !!
Matt Raible
author
Ranch Hand

Joined: Jan 11, 2001
Posts: 114
hi, Matt Raible , as compare to other MVC framework like struts, jsf .. how spring perform as compare among other framework in term of speed and stability


In my experience, Spring's MVC framework is just as stable and speedy as the other frameworks. In most cases, the performance of an application is hindered by the database throughput moreso than the MVC framework. If you have proper indexes in your database - performance shouldn't be a problem.

In Chapter 6 of Spring Live, I show how easy it is to use Velocity and FreeMarker with Spring MVC. Both of these are templating frameworks (like JSP), but they're a lot nicer to develop with since you don't have to wait for the initial-compile like you do with JSPs.

If you're looking for speed and performance, you can often hook in some sort of caching engine to really speed things up. I also recommend using a Compression (GZip) filter to compress the data you send to clients browsers.

If you want to compare Spring MVC, Struts and WebWork - my open source AppFuse project allows you to use any of these web frameworks - and it includes unit tests/tutorials for all of them.


Matt<br /> <br />Author: <a href="http://springlive.com" target="_blank" rel="nofollow">Spring Live</a> and <a href="http://www.apress.com/book/bookDisplay.html?bID=256" target="_blank" rel="nofollow">Pro JSP</a><br />Weblogs: <a href="http://raibledesigns.com" target="_blank" rel="nofollow">Raible Designs</a> <a href="http://jroller.com/page/raible" target="_blank" rel="nofollow">Spring Live Blog</a>
Alvin chew
Ranch Hand

Joined: Jan 08, 2004
Posts: 834
hi, mr.Matt Raible , from your opinion, when should we use spring rather than struts ? if there is not much different between spring and struts, why the developer need to pay attention on spring ?
Matt Raible
author
Ranch Hand

Joined: Jan 11, 2001
Posts: 114
Originally posted by Alvin chew:
hi, mr.Matt Raible , from your opinion, when should we use spring rather than struts ? if there is not much different between spring and struts, why the developer need to pay attention on spring ?


When you're tired of writing ActionForms and using BeanUtils.copyProperties() to transfer property values from your Forms to your POJOs. ;-)

The one thing that Struts has over Spring is a rich HTML tag library for forms. The good news is that if you're using JSP 2.0 - you can use
these simplification tags for Spring.

To compare, below is a listing comparing 3 different JSPs - one from Struts, one from Spring and one from WebWork. You'll see that the WebWork one actually has the least amount of required code:

  • Struts JSP
  • Spring JSP
  • WebWork JSP


  • The best part of Spring is not its MVC Framework - it's the IoC container that allows you to inject your dependencies, rather than looking them up or using a Factory Pattern. You code becomes a lot cleaner and easier to test.
     
     
    subject: Spring live book - Performance issue