Spring as a Lightweight Framework



Did you know that some parts of J2EE can be defined as frameworks themselves? Among them, for example: EJB amounts to a framework because it provides a structure for application code, and it defines a steady way of accessing services from the application server

However, the EJB framework is hard to use and rather restrictive comparing to Spring framework. Developers must deal with three to four Java classes for each EJB. The EJB component model, below EJB 2.1 version, fails to deliver on many of primary goals, and also a workable structure for business logic in J2EE applications. The EJB Experts Group has finally realized that and are attempting to overhaul the EJB model in EJB 3.0, but there is a better solution for that, and Spring Framework proudly demonstrates a much better solution in most cases.

As the name says, lightweight frameworks not only set their goals to reduce complexity in application code, but also dodge unnecessary complexity in their own working process. Lightweight framework won't have a high startup time, also won’t involve huge binary dependencies in code, will run in any environment given, and won't place obstacles in the way of testing.

While old J2EE was described by high complexity and a muddle of weird "design patterns" to give it intellectual respectability, lightweight J2EE is trying to find “the simplest thing that can work".