Skip to main content

Posts

Showing posts with the label SPRING CORE

Spring : Terminology and Components of Spring IOC

Terminology and Components of Spring IOC 1. Bean- An object which is created and managed by IOC Container is a Bean. 2. BeanFactory- is an interface which describe the functionality of a basic IOC Container. Any class which implements this interface represents as an IOC Container. 3. XMLBeanFactory- is a framework provided class which implements BeanFactory Interface; an Object of XMLBeanFactory requires Bean Configuration File i.e. A XML Document. 4. Resource- is an interface it provides methods of managing the beans Configuration. Different implementations of this interface are provided by the framework. a. ClassPathResource- It is used when the configuration file/required file is in class path (A default path for placing the classes that is “build” in case of desktop/console application and WEB-INF in case of Web Application). This is mostly used in Web Application because developer doesn’t know the exact path when the application is deployed on server. Its default searching approac...

Spring : Core (IOC Container)

First we will understand what is IOC- Inversion of Control, The concept of IOC deals with Object Creation, Dependency Satisfaction & Life Cycle Management. The concept states that application programmers must only be concern with the use of Objects, they shouldn’t be concern with their creation and life cycle management. Application programmers should delegate these responsibilities to a Runtime Environment called IOC Container. Conventionally application programmers waste more than 50% of their efforts in object creation & their management as we can describe this situation by the following example. Let's there be two classes named A & B. Class A has a dependency on Class B i.e. an Object of Class B is required by an Object of Class A to Perform its task. The conventional approach does this thing as. 1. Application need an Object of Class A. 2. Object of Class A is created let ObjA. 3. Object of B class is created let ObjB. 4. Reference of ObjB is provided to ObjA. 5. O...