Where do we classify the Spring framework of a thing. Is it for business component development or front end web component development or both ? I am really interested in knowing the difference between Spring and Tapestry and the advantage one might have over the other and/or how these two will work together in a given application.
Tapestry is a web application framework, while Spring is more of J2EE (or Java) application framework. It has allows you to use dependency injection in your data layer and middle tier and also has many concepts that make it easier to develop these layers.
For example, you can use the HibernateDaoSupport class to serve as a parent to your DAOs and reduce many of your Hibernate operations to 1-liners. For the middle-tier, you can use Spring's declarative transactions to wrap your method calls with transactions and rollback rules.
Spring does have a web framework component as well. It's similar to Struts, but it allows you to use your domain objects in your controllers. It also has a lifecycle for its many controllers - allowing you to overriding binding, validation, etc., which can be nice.
Thanks Matt and Ali Pope. If Spring is a J2EE application framework. It follows that Spring is a competitor to J2EE. Basically I see Struts or Tapestry as a competitor to JSP and Hibernate a competitor to EJB. Should this be the case, how much functionality does Spring offer compared to J2EE and its vast array of APIs such as Messaging, JAXP, e.t.c. or one has to borrow some of this from the J2EE framework when the need arises. I understand that SUN has been on the J2EE train for so long and Spring is a fresh birth, but how much of this functionalities does it provide outside providing one with lightweight front end and back end components?
posted 15 years ago
Anselm: Spring is not a J2EE container, meaning it doesn't need to conform the J2EE specs. But, the Spring guys have integrated already in the framework many (if not all) of the offerings of a J2EE compliant container. Try to look at the official Spring document and see how much they are offering.
If Spring is a J2EE application framework. It follows that Spring is a competitor to J2EE.
In my opinion, it's not a competitor to J2EE, but rather a complement to J2EE. Using Spring to develop your J2EE application makes things much simpler. You don't need to write nearly as much code, you get to follow best practices and J2EE patterns, and your app will be loosely coupled. In essense, you get to quite worrying about the "architecture" of your application and start worry about the problem it's trying to solve.
I understand that SUN has been on the J2EE train for so long and Spring is a fresh birth, but how much of this functionalities does it provide outside providing one with lightweight front end and back end components?
Spring does not hide any of J2EE's APIs. You can still use any of the APIs you previously used. However, it's possible that Spring has done something to make things simpler and more configurable, so you might want to use some Spring helper classes - or at least wire up your dependencies using its IoC container.
Spring is a very non-intrusive framework that only takes a couple hours to dig in and learn about. Spring Live is designed for the Spring rookie so it should make it even simpler to learn Spring.