Skip to main content

Posts

Showing posts with the label BEAN DEPENDENCY MANAGEMENT

Spring : Bean configuration & Management

BEAN CONFIGURATION & DEPENDENCY MANAGEMENT :  To configure the beans and their dependency <bean> element is used. This element supports multiple attributes, most commonly used among them are as follows: 1. id: is used to assign a unique identifier to the bean. 2. class: used to specify the class name of the bean. 3. factory-method: is used to specify the method which is to be used by the IOC Container for creating the requested bean. 4. factory-bean: to specify the bean which is to is used by the IOC Container for creating the requested bean. 5. scope: to specify the scope of the bean; A bean can have either of the following scope: a. Singleton: It is the default scope for the beans, singleton beans are created Only once by the container when they are requested for the very first time. They are shared by the multiple users. b. Prototype: Prototype beans are created each time they are requested from the container. They are used when different users need to represent ...