Advantages and Disadvantages of using the Spring framework

J

josh.s17

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
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

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
 
J

Juha Laiho

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

Daniel Pitts

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

John Ersatznom

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...
 
Joined
Dec 9, 2011
Messages
1
Reaction score
0
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:

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top