Key features of Spring
Lightweight—spring is lightweight in terms of both size and overhead. The entire spring framework can be distributed in a single JAR file that weighs in at just over 1 MB. And the processing overhead required by spring is negligible. What’s more, spring is nonintrusive: objects in a Spring-enabled application typically have no dependencies on spring specific classes.
Inversion of control—Spring promotes loose coupling through a technique known as inversion of control (IoC). When IoC is applied, objects are passively given their dependencies instead of creating or looking for dependent objects for themselves. You can think of IoC as JNDI in reverse—instead of an object looking up dependencies from a container, the container gives the dependencies to the object at instantiation without waiting to be asked.
Aspect-oriented—Spring comes with rich support for aspect-oriented programming that enables cohesive development by separating application business logic from system services (such as auditing and transaction management). Application objects do what they’re supposed to do—perform business logic—and nothing more. They are not responsible for (or even aware of) other system concerns, such as logging or transactional support.
Container—spring is a container in the sense that it contains and manages the life cycle and configuration of application objects. It can be configured to how your beans should be created—either creates one single instance of your bean or produce a new instance every time one is needed based on a configurable prototype—and how they should be associated with each other. Spring should not, however, be confused with traditionally heavyweight EJB containers, which are often large and cumbersome to work with.
Framework—spring makes it possible to configure and compose complex applications from simpler components. In Spring, application objects are composed declaratively, typically in an XML file. Spring also provides much infrastructure functionality (transaction management, persistence framework integration, etc.), leaving the development of application logic to you.
All of these attributes of Spring enable to write code that is cleaner, more manageable, and easier to test. They also set the stage for a variety of sub frameworks within the greater spring framework.
Spring modules

The Spring framework is made up of seven well-defined modules (sub frameworks) .When taken as a whole; these modules give you everything you need to develop enterprise-ready applications. But you do not have to base your application fully on the Spring framework. You are free to pick and choose the modules that suit your application and ignore the rest. All of Spring’s modules are built on top of the core container. The container defines how beans are created, configured, and managed—more of the nuts-and-bolts of Spring. .These modules will provide the frameworks with which will build the application’s services, such as AOP and persistence pr MVC.
The core container: Spring’s core container provides the fundamental functionality of the Spring framework. In this module you’ll find Spring’s Bean Factory, the heart of any Spring-based application. A Bean Factory is an implementation of the factory pattern that applies IoC to separate the application’s configuration and dependency specifications from the actual application code.
The Spring MVC framework: Spring comes with a full-featured Model/View/Controller (MVC) framework for building web applications. Although Spring can easily be integrated with other MVC frameworks, such as Struts, Spring’s MVC framework uses IoC to provide for a clean separation of controller logic from business objects. It also allows to declaratively binding request parameters to the business objects.
No comments:
Post a Comment