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 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Spring" Watch "Spring" New topic
Author

Spring

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

When to use and when not to?


Groovy
Matt Raible
author
Ranch Hand

Joined: Jan 11, 2001
Posts: 114
I would suggest adding it in small chunks to an existing project. Its IoC container is a pretty nice feature and allows you to get rid of an ServiceLocators or other factory pattern type classes. If you're using Hibernate, it makes it quite a bit easier to use. Also, it's ability to manage all your connections for you make it much easier to write code - you don't have to worry about resource management so much.

I'd advise trying to introduce it in your data layer and as you use it, you'll see you probably have other areas where you can use it.


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>
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Thanks Matt!

If you're using Hibernate, it makes it quite a bit easier to use.


Is it tightly integrated with Hibernate?
Matt Raible
author
Ranch Hand

Joined: Jan 11, 2001
Posts: 114
No, Spring is not "tightly" integrated with Hibernate. It merely has support classes that allow you to configure its SessionFactory and use a HibernateTemplate which can reduce methods in a DAO to simple one-liners.
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Spring is not event tightly integrated with itself . To be more clear Spring delivers many small pieces of functionality. You will not be required to always include the whole Spring jar, but just to choose exactly what piece of work it you need.

./pope


blog - InfoQ.com
Eusebio Floriano
Ranch Hand

Joined: Mar 07, 2004
Posts: 237
Originally posted by Matt Raible:
No, Spring is not "tightly" integrated with Hibernate. It merely has support classes that allow you to configure its SessionFactory and use a HibernateTemplate which can reduce methods in a DAO to simple one-liners.


Matt,
Odes Spring supports others persistence layers like JDO ?

Regards,


SCJP 1.4 / 5.0 - SCBCD 1.3 - SCWCD 1.4 - IBM 484
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Vinicius Boson:
Odes Spring supports others persistence layers like JDO ?

Yep. Last I checked, Spring supported Hibernate and JDO. Although I think Matt has blogged about other integrations being in CVS already some time ago? Am I remembering correctly?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Spring is also perfectly integrated with iBatis.

./pope
[ October 29, 2004: Message edited by: Ali Pope ]
Matt Raible
author
Ranch Hand

Joined: Jan 11, 2001
Posts: 114
Originally posted by Vinicius Boson:

Odes Spring supports others persistence layers like JDO ?


Yes. Spring has its own JDBC Framework, which makes JDBC much easier (no resource management needed). It also has support for iBATIS, OJB and JDO. OJB and JDO are not in Spring's reference documentation, but JPOX has a good JDO+Spring tutorial.

OJB examples are in the Spring jPetstore application, as well as in Chapter 7 of Spring Live. Chapter 7 covers all 5 frameworks mentioned above.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring