- Dependency Injection
- Coding to Interface
- Aspect Oriented Programming
What is Dependency Injection?Dependency Injection is used to decouple the dependence between the objects within a class and to provide the dependency (i.e. instantiation, initialization) from outside configuration to the class.
Factory Design Pattern is used in Spring Framework. Means instead of directly instantiating an object, we ask the particular Object Factory to manage (create, maintain lifecycle, destroy) the object and pass to us a reference of the object.
|BeanFactory fcty = new XmlBeanFactory(new FileSystemResource(“userspringconfig.xml”))||ApplicationContext fcty = new ClassPathXmlApplicationContext(“userspringconfig.xml”)|
|-||Supports Annotation based dependency Injection.|
|-||Supports Internationalization (I18N) messages|
|-||Supports many enterprise services such JNDI access, EJB integration, Remoting|
|-||Can publish events to beans that are registered as listeners|