Pages

Showing posts with label IoC. Show all posts
Showing posts with label IoC. Show all posts

Tuesday, July 13, 2010

Inversion of Control

A common issue faced by enterprise application builders is how to fit together different elements, such as web controller architectures with DB interfaces, when they were built by different teams with little knowledge of eachother. IoC literally inverts control so that instead of application code calling libraries, libraries call the application code based on events occurring.

A good example of early IoC is the change in UIs, from being controlled by the application workflow, to GUIs which are controlled by events.

Another term for IoC is dependency injection, introduced by Martin Fowler, which is explained as follows: "The basic idea of Dependency Injection is to have a separate object, an assembler, that populates a field in X class with an implementation for Y interface."

Thursday, July 1, 2010

Spring Overview

Spring is an open source framework created to address the complexity of enterprise application development and promote good programming practices. It does this by enabling a POJO-based programming model that is applicable in a wide range of environemnts.

Spring has a layered architecture so almost any part of it can be used in isolation. For example, Spring may be used just to simplify use of JDBC.

It consists of the following 7 modules:
  1. Core container module - provides the IoC features
  2. Application context module -
  3. AOP module - provides an AOP implementation
  4. ORM module - provides integration layers for popular OR mapping APIs (eg: JPA, JDO, Hibernate)
  5. DAO module - provides a JDBC abstraction layer
  6. Web module - provides basic web-oriented integration features
  7. MVC framework - provides a MVC implementation for web applications
The Spring BeanFactory, the foundation of Spring as an IOC container, is a generic factory that enables configured objects to be retrieved by name, and which can manage relationships between objects.

The ApplicationContext builds on top of the BeanFactory and adds other functionality, such as easier integration with AOP features, message resource handling, event propagation, etc.
 
Powered by Blogger