Originally posted by Jothi Shankar Kumar Sankararaj: In my opinion Spring = EJB3.0 + Struts. Am I rught guys??
That's one way of looking at it...not entirely accurate, but certainly not invalid.
At it's very core, Spring is a dependency injection container. For a moment, forget everything else that Spring does...at it's core, its purpose is to wire application objects together in a loosely-coupled way using dependency injection.
Then, on top of that Spring offers AOP support. AOP is also a mechanism for loose-coupling, but different from DI. Where DI decouples your application objects from each other, AOP decouples functional concerns from the objects that they are applied to. (Logging and security are common examples here).
Then, on top of AOP, Spring offers declarative transactions (similar to EJB). And Spring Security uses AOP for declarative security. And Spring Modules Caching uses AOP for declarative caching.
Then there's a host of other frameworks and APIs built on top of the core Spring container. This includes Spring MVC for web apps, Spring remoting for turning POJOs into remote objects, Spring's data access abstractions for removing the boilerplate code from data access, etc, etc, etc.
There's also a rich client framework, a contract-first web services framework, support for JMS, support for JMX, and a ton of other stuff. Spring even has stuff to integrate with EJBs.
So, yes, there are portions of Spring that resemble and offer similar (or in some cases, superior) features as Struts and EJB 3. But to say that Spring == EJB 3 + Struts, is shortchanging Spring quite a bit.
The really cool thing is that although Spring does a lot of different things, you don't have to use them all. Spring's very modularized, allowing you to use the bits you need and ignore the rest.
Thanks Craig for the clarification. The book Spring in Action is a good one for a beginner?? I'm right now working on jsp/servlet/struts technologies and I want to build a career in either EJB or Spring and I wanted to land in a good one before I could start delving in these two technologies! So which one do you suggest keeping in mind the job market and demand for people with Spring or EJB skills??
Any good books guys you can suggest for a beginner in spring. A book that has everything in place along with the IDE needed to work in Spring.
Joined: Sep 19, 2003
Originally posted by Jothi Shankar Kumar Sankararaj: Thanks Craig for the clarification. The book Spring in Action is a good one for a beginner??
I think it's pretty good! But, of course, I'm biased.
Even so, I don't mind plugging the other Spring books. For beginners, I think that Rob Harrop's "Pro Spring" is pretty good. And Matt Raible's "Spring Live" ain't too shabby, either.
So which one do you suggest keeping in mind the job market and demand for people with Spring or EJB skills??
Again, I'm Spring-biased, so my first response is to recommend Spring.
But truthfully, if you have the time to do so, I recommend that you learn both Spring and EJB 3, as both will be very marketable skills. And if you have both skills, then you're that much more dangerous in the marketplace.
Joined: Sep 19, 2003
Originally posted by Jothi Shankar Kumar Sankararaj: One more information I want to know is that what about the implementation of security in Spring framework??
Spring Security (formerly known as Acegi Security) uses a mix of aspects and servlet filters for security. Aspects are used to secure method invocations, while servlet filters are used to secure web requests.
Spring Security's scope covers everything from authentication to authorization to ACLs. And the nice thing about it is that it is based on interfaces and dependency injection. Therefore, it's highly pluggable and very flexible.
All your posts were really helpful and now I'm going to head towards learning Spring. I did not work in EJB before though I have extensive experience using jsp/servlets. When I was considering to learn EJB 2.1 to actually prepare for the SCBCD examination, I came to know that EJB 3.0 is ready, so I decided to skip SCBCD and better give SCWCD. Now when I wanted to advance my skills in the J2EE arena, I thought to myself which server side business component will I go for. So I got this in mind as I read in many places these words "...nowadays many companies are moving towards lightweight frameworks like Spring..." So I started to explore what it is all about and now I realize that Spring is the equivalent of EJB and perhaps more. So I decided to first master Spring as I will be shortly required to work on it. Maybe later in the future go for EJB 3.0 depending on its reception in the J2EE industry.
Once again thanks Craig for all your valuable ideas!
I got Spring in Action and its perfect. I recommend this book without hesitation. This book is my first dance with spring.
I would strongly recommend you start by the 3rd part "Spring in the web layer" though. Coming from JSP/Servlet, I found that to be a lot easier. This will give you a quick idea of how Spring MVC compares to struts.
However, if you just don't care about the web part, jump in from chapter1. The spring modules are very independent and can be used as you wish.
I'm far from mastering Spring, I'm just a simple dude with the book
(I understand though that the AOP and IoC are the basis of spring, so the book's order makes sense, but I believe is not the easiest path for most of people...)