Results 1 to 4 of 4

Thread: Newbie Question - The Ideal Spring Solution

  1. #1
    Join Date
    Aug 2005
    Location
    Ireland
    Posts
    3

    Default Newbie Question - The Ideal Spring Solution

    Hi folks,

    I'm looking at possible architectures for a new project I'm working on. As I'm new to Spring, I'd like to ask some questions about what Spring can offer a new project. Apologies if I'm completely missing the point!

    Some questions:

    1) Why use Spring to access a framework like Hibernate? Surely this is just adding complexity to an application? Surely one of the compelling reasons of using Hibernate is to take away some of the pain in using a home-grown JDBC solution. Why not use Spring's own JDBC abstraction layer. Confused!

    2) I've lots of Struts/JSP experience. Why would one replace Struts with the Spring Web framework? Why would one integrate Struts with Spring (which I understand is possible) when just using Struts is simpler?

    3) If you were designing a completely new web application, which elements of Spring would you definitely use? Which would you leave behind? In short, describe an optimum application design which uses the Spring framework.

    Thanks in advance for your replies.

    Kind regards.
    cp.

  2. #2
    Join Date
    Nov 2004
    Location
    Hilversum - The Netherlands
    Posts
    1,054

    Default Re: Newbie Question - The Ideal Spring Solution

    Quote Originally Posted by conorp
    Hi folks,

    I'm looking at possible architectures for a new project I'm working on. As I'm new to Spring, I'd like to ask some questions about what Spring can offer a new project. Apologies if I'm completely missing the point!

    Some questions:

    1) Why use Spring to access a framework like Hibernate? Surely this is just adding complexity to an application?
    I agree.. I have complexity.. and I especially hate complex webapplications (always something breaks/goes wrong and it costs time). But Spring gives you a very stable base you complete application is build/configured/managed in. I love it because I`m 110% back in the drivers seat.. Spring added some complexity.. but it remove a lot of complexity also.

    Surely one of the compelling reasons of using Hibernate is to take away some of the pain in using a home-grown JDBC solution. Why not use Spring's own JDBC abstraction layer. Confused!
    Spring is not a or-mapper. Spring only makes it easier to use existing or-mappers like hibernate.

    Spring doesn`t have a big influence on architecture imho. You can glue your bean togehter in Spring, and maybe enhance them (security/transaction), but as far as your normal objects are concerned.. spring doesn`t exist.

    2) I've lots of Struts/JSP experience. Why would one replace Struts with the Spring Web framework? Why would one integrate Struts with Spring (which I understand is possible) when just using Struts is simpler?
    I think both of them are bad. Model2 based webframeworks criple the mind.. But if you know struts and are happy with it.. it would use Struts. Spring doesn`t force you to use Spring-MVC. There even is a Struts plugin for Spring.

    3) If you were designing a completely new web application, which elements of Spring would you definitely use? Which would you leave behind? In short, describe an optimum application design which uses the Spring framework.
    It depends on the situation and on your needs. If you are making a 13 in a dozen webapplication.. hibernate/spring and a webframework (maybe you could have a look at tapestry/wicket/click)

  3. #3
    Join Date
    Aug 2005
    Location
    Ireland
    Posts
    3

    Default

    Hmm. I suppose what I'm confused about is the compelling reason to learn Spring when all I may use it for is it's abstraction over a data access framework (either Jdbc or Hibernate). It doesn't seem like a good reason to introduce yet another framework into an application.

    Why would I replace my Struts MVC layer with Spring MVC? What features does it give me that I don't get with Strusts?

    I must say, I decided to look into Spring because I heard I could develop in applications in less time, with less code. Based on this, which features of Spring give the most benefit?

    Thanks again.

    cp.

  4. #4
    Join Date
    Aug 2004
    Posts
    1,905

    Default

    I would go with spring mvc.

    The key thing for spring is plugability. The MVC "stack" is comprised of interface based collaborators for which you can provide your own implementation at any point.

    Don't want to use jstl, but want to use your own custom rendering, fine. Want to change how request parameters are bound to your form backing object. Fine.

    Sticking with a well known framework (spring MVC) buys you a lot of other people's experience

Similar Threads

  1. newbie jboss spring question
    By bsideindy in forum Data
    Replies: 2
    Last Post: Sep 9th, 2008, 01:15 PM
  2. Newbie question: How to get spring debug logging on?
    By wangjammer5 in forum Container
    Replies: 2
    Last Post: Jul 15th, 2005, 07:11 AM
  3. Replies: 1
    Last Post: Jul 11th, 2005, 03:50 PM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Spring newbie - http session question
    By ncubeait in forum Web
    Replies: 3
    Last Post: Sep 22nd, 2004, 11:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •