Java Reference
In-Depth Information
Figure 2-1. High-level building blocks of the Spring Framework
Spring Core
The Core module forms the backbone of the entire Spring Framework. All other Spring
modules are dependent on this module. It is also called the IOC container and is central
to Spring's support for dependency injection (DI).
Inversion of Control
IOC is best described by the term the Hollywood principle , which states “Don't call us;
we'll call you.” (The junior artists often hear this from production managers in Holly-
wood.) However, this is important in software development as well to control the flow of
applications while ensuring high cohesion and low coupling. To better understand, this
let us consider a simple case when your application performs some calculations and
prints the end result using a logging library like log4j. In this case, the application code is
responsible for the flow of control while invoking methods on the log4j API as and when
IOC, on the other hand, is fundamental to any framework. With IOC, an application
object is typically registered with the framework that takes the responsibility of invoking
methods on the registered object at an appropriate time or event. The control is inverted
because instead of application code invoking the framework API, things happen just the
opposite. Thus, in short, IOC is the principle of allowing another object or framework to
invoke methods on your application objects on the occurrence of appropriate events.
Search WWH ::

Custom Search