Originally posted by Mark Citizen:
Based on my own experience Spring is better for simple web applications (quick deployment, relatively easy to code), while EJB is better for B2B services, and complex distributed apps.
I don't agree with this. There's nothing in Spring that puts a limit on complexity. Maybe simple web apps and easy to code is all you've used Spring on, but I don't think that's a limitation that Spring imposed on you.
One thing: if you know you need to use EJBs, I wouldn't recommend mixing them with Spring, since you'd need to maintain both application descriptors and Spring xml config files (not to mention the coding part).
Since the whole point of Spring is to make it possible to do
Java EE without EJBs, I'd agree that it makes less sense to deploy Spring with EJBs. But there's no reason a legacy app that already has EJBs can refactor or add new functionality using Spring that co-exists with EJBs.
Maintaining descriptors and config files aren't the worst part of complex systems. I think that's what XDoclet and annotations are for. Generate them.
Regardless of what Spring framework website says, it's not a walk in the park.
Indeed, but that's true of all complex, enterprise systems. EJBs aren't a walk in the park, either. We still haven't hit on a single technology that reduces complexity to the point where it writes itself.