This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Spring

 
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When to use and when not to?
 
author
Posts: 114
  • 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: 8943
Firefox Browser Spring Java
  • 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
Posts: 114
  • 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.
 
Ranch Hand
Posts: 995
  • 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
 
Ranch Hand
Posts: 241
  • 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,
 
author
Posts: 11962
5
  • 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
  • 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
Posts: 114
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic