This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring

 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When to use and when not to?
 
Matt Raible
author
Ranch Hand
Posts: 114
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 114
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 995
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Eusebio Floriano
Ranch Hand
Posts: 237
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring is also perfectly integrated with iBatis.

./pope
[ October 29, 2004: Message edited by: Ali Pope ]
 
Matt Raible
author
Ranch Hand
Posts: 114
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic