Advantages and Disadvantages of using the Spring framework

Discussion in 'Java' started by josh.s17@gmail.com, Dec 30, 2006.

  1. Guest

    Hi,

    I just wanted explore whether my experiences with using the spring
    framework are a common
    experience.

    I can see same great advantages with using Spring however I
    have this nagging feeling that it isn't the magic solution that some
    people seem to make it out to be.

    My gut feeling is the Spring framework is something that only
    "experienced" java developers would appreciate and choose to use as it
    solves problems that that large commercial developers comes across
    often eg jdbc error handling is quite ugly but Spring JDBC templates
    solves this problem.

    However the downside of Spring is trying to learn it. Learning J2SE.
    then J2EE (even just the web component parts) and also some widely
    used java frameworks takes a long time. Mastering or even being a
    novice at the Spring framework take a fair amount of time in addition
    to this.

    I'm also concerned that the extra configuration involved in using
    Spring can reduce the understandability of the code for a newcomer
    especially if they are not a Spring expert themselves.

    Any thoughts?

    Josh
    , Dec 30, 2006
    #1
    1. Advertising

  2. wrote:
    > I just wanted explore whether my experiences with using the spring
    > framework are a common
    > experience.
    >
    > I can see same great advantages with using Spring however I
    > have this nagging feeling that it isn't the magic solution that some
    > people seem to make it out to be.
    >
    > My gut feeling is the Spring framework is something that only
    > "experienced" java developers would appreciate and choose to use as it
    > solves problems that that large commercial developers comes across
    > often eg jdbc error handling is quite ugly but Spring JDBC templates
    > solves this problem.
    >
    > However the downside of Spring is trying to learn it. Learning J2SE.
    > then J2EE (even just the web component parts) and also some widely
    > used java frameworks takes a long time. Mastering or even being a
    > novice at the Spring framework take a fair amount of time in addition
    > to this.
    >
    > I'm also concerned that the extra configuration involved in using
    > Spring can reduce the understandability of the code for a newcomer
    > especially if they are not a Spring expert themselves.


    Spring has become a very huge framework.

    I would strongly advice against using everything of it just
    because of the Spring==good hype.

    Look at what parts of Spring really provides some benefits for
    your project and use those parts.

    A lot of the stuff is pretty good and it is much better to
    use Spring than create your own equivalent solution seen
    from a maintenance perspective.

    Spring is being actively maintained and if you hire a Java
    programmer today is is very likely that he/she has at least
    some experience with Spring, because it is very popular.

    Spring is like patterns. If you have a problem that really fits
    a pattern then use the pattern. But don't look for ways
    of applying all possible patterns.

    Arne
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Dec 30, 2006
    #2
    1. Advertising

  3. Juha Laiho Guest

    "" <> said:
    >I just wanted explore whether my experiences with using the spring
    >framework are a common experience.
    >
    >I can see same great advantages with using Spring however I
    >have this nagging feeling that it isn't the magic solution that some
    >people seem to make it out to be.


    Somewhat agreed. But the same goes for a number of other things as well.
    For some funny reason, most of the "new" things are seen as cure-all-ails.

    >I'm also concerned that the extra configuration involved in using
    >Spring can reduce the understandability of the code for a newcomer
    >especially if they are not a Spring expert themselves.


    I wouldn't be too concerned of this, given the company has at least
    some sense (enough that, if applications are written using Swing,
    the new recruits would at least preferably have some experience
    with Spring). If, on the other hand, the company preferably employs
    the ones it gets with the lowest price, then there will be problems
    no matter that the technology choices are.
    --
    Wolf a.k.a. Juha Laiho Espoo, Finland
    (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
    PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
    "...cancel my subscription to the resurrection!" (Jim Morrison)
    Juha Laiho, Dec 30, 2006
    #3
  4. Daniel Pitts Guest

    wrote:
    > Hi,
    >
    > I just wanted explore whether my experiences with using the spring
    > framework are a common
    > experience.
    >
    > I can see same great advantages with using Spring however I
    > have this nagging feeling that it isn't the magic solution that some
    > people seem to make it out to be.
    >
    > My gut feeling is the Spring framework is something that only
    > "experienced" java developers would appreciate and choose to use as it
    > solves problems that that large commercial developers comes across
    > often eg jdbc error handling is quite ugly but Spring JDBC templates
    > solves this problem.
    >
    > However the downside of Spring is trying to learn it. Learning J2SE.
    > then J2EE (even just the web component parts) and also some widely
    > used java frameworks takes a long time. Mastering or even being a
    > novice at the Spring framework take a fair amount of time in addition
    > to this.
    >
    > I'm also concerned that the extra configuration involved in using
    > Spring can reduce the understandability of the code for a newcomer
    > especially if they are not a Spring expert themselves.
    >
    > Any thoughts?
    >
    > Josh


    Its been my experience with Spring that, while it does have a little
    extra learning curve, once you become comfortible with IoC and
    dependency injection, its hard to go back. As for the plugins to the
    framework, I would treat them on a case by case basis. I've had good
    luck using Spring Web Flow, Spring framework, Hibernate (with the
    spring wrappers), etc...

    As someone else in this thread said, many "new" things get the label of
    cure-all. Just like at the hype of Ajax.

    Hope this helps.
    Daniel.
    Daniel Pitts, Dec 31, 2006
    #4
  5. wrote:
    > Hi,
    >
    > I just wanted explore whether my experiences with using the spring
    > framework are a common
    > experience.
    >
    > I can see same great advantages with using Spring however I
    > have this nagging feeling that it isn't the magic solution that some
    > people seem to make it out to be.


    Of course it isn't, since (as always) there is no magic bullet.

    But it may nonetheless be useful. Be careful of overapplying something
    just because it is buzzword-compliant or even just because it is
    genuinely useful. Your nice shiny hammer is wonderful for carpentry, but
    I don't recommend trying to repair your stereo system with it...
    John Ersatznom, Jan 4, 2007
    #5
  6. asifpmna

    Joined:
    Dec 9, 2011
    Messages:
    1
    My Experiance with Spring and Hibernate.

    As far as i am concerned Spring and Hibernate both are powerful technologies in java. Both can be used for building complicated Enterprise Applications. If u are going to develop a simple application then i recommend u not to go for spring and hibernate. U will get benefit out of this only if it is a huge application. Both frameworks have advantages and disadvantages. First we can discuss the advantages and disadvantages of Hibernate. Hibernate Advantage 1). Object Relational Mapping :- Java is an Object oriented language but the database we are using is a relational database. In java everything is object then the problem is how we can store an object into a relational database. The programmer has to write a lots of code to convert an object into relational data model. This is a tedious task. Hibernate can solve this problem. Hibernate transparently convert every object into relational data model. So a programmer don't want to worry about how data is stored in the database but he can concentrate more on the business logic. 2). Less code to write:- As i mentioned earlier hibernate will take care of the object conversion. Hibernate will generate SQL queries. 3). Relationship between tables. :- We can simply map the relationship between tables in the domain object. The relationship may be OneToOne, OneToMany, ManyToOne, ManyToMany. Here when we load the parent object the child objects will be automatically loaded by the help of hibernate. Here we don't want to write complex queries to fetch data from more than one table. 5). Improved Performance. :- Actually the performance of the application will slow down if we use hibernate because hibernate has to generate the sql queries at run time. But we can improve the performance by using some performance tuning like sophisticated caching, Lazy loading and Eager loading. 6). HQL query:- Hibernate support a fully object oriented query language ie Hibernate Query Language(HQL). Using HQL we can directly return objects from database. HQL also simplyfies the joins. 7). Improved Portability:- It is very easy to migrate from one database to another database using hibernate. We need to do a minor code change in the configuration level. 8). Table name and column name change wont affect the application. If we are changing the table name or column name we need to make change only in the domain class. 9). Automatic key generation: Hibernate support a verity of ways to generate the primary key for a table. 10). Concurrency control:- In JDBC and all the programmer has to write code manually for controlling concurrency. But in hibernate there is a version control mechanism. By implementing the version control hibernate itself will check for the concurrency. 11). In hibernate we can write all the HQL and SQL queries in one file there by separating the java code and queries differently. Disadvantages of Hibernate 1) Hibernate is a layered arthitecture containing three layer,a) Connection Management b) Transaction Management c) and ORM Layer. But here Connection management and Transaction Management has performance issue. But this problem we can solve by using hibernate ORM Layer and can depend some other frame works like spring for Connection management and Transaction Management. 2) Performance issue:- Hibernate has to generate SQL queries before communicating with Database at run time. This will slow down the performance. But we can increase the performance by performance tuning. ie actually complicated and only experts can do that. 3)There are certain queries that we can not implement in HQL. There for we still have to depend on SQL for some scenarios.
    Last edited: Dec 9, 2011
    asifpmna, Dec 9, 2011
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    9,307
    Darryl L. Pierce
    Sep 11, 2005
  2. Replies:
    2
    Views:
    1,452
    John Ersatznom
    Jan 4, 2007
  3. sumankumar
    Replies:
    0
    Views:
    446
    sumankumar
    Aug 25, 2007
  4. rmn190
    Replies:
    2
    Views:
    2,352
    Arne Vajhøj
    Jan 10, 2008
  5. Martin Arvidsson, Visual Systems AB

    Q: SqlConnection, Open/Close advantages / disadvantages

    Martin Arvidsson, Visual Systems AB, Apr 2, 2008, in forum: ASP .Net
    Replies:
    5
    Views:
    436
    George Ter-Saakov
    Apr 2, 2008
Loading...

Share This Page