Types of Dependency Injection in Spring Framework

Posted Posted in Spring, Spring Core

Types of Dependency Injection in spring framework: There are basically two types of dependency injection which are – Setter Injection. Constructor Injection. There are generally three types of dependency which we inject: Dependent Object(Class object). String and int, long…etc(primitive types). Collections(List,Set,Map…etc). Here the “types of dependency which we inject” are basically the types of argument […]

AUTOWIRING IN SPRING FRAMEWORK

Posted Posted in Spring

Autowiring in spring framework: it’s a feature of spring framework by which spring automatically injects one dependency into the another dependency or in a more formal way we can say implicitly wires the two dependencies.BENEFITS/NON There are 4 modes of Autowiring supported by spring: byName byType constructor no Let’s understand the above description of autowiring […]

INJECTION OF MAP(JAVA COLLECTION) USING SETTER AND CONSTRUCTOR DEPENDENCY INJECTION

Posted Posted in Spring

In our previous tutorial we learned how to inject java collection java.util.Set using spring framework, In this tutorial, we will learn how to inject java collection java.util.Map using Setter and Constructor Injection. Setter Injection using Map values: As we know map contains key-value pair so In setter injection using a Map, we define a tags like below in our […]

INJECTION OF SET (JAVA COLLECTION) USING SETTER AND CONSTRUCTOR DEPENDENCY INJECTION

Posted Posted in Spring

In our previous tutorial we learned how to inject java collection java.util.List using spring framework, In this tutorial, we will learn how to inject java collection java.util.Set using Setter and Constructor Injection. Setter Injection using Set values: In setter injection using a List, we define a tag <property name=”name of variable” > <set> <value>data 1</value> <value>data 2</value> <value>data n</value> </set> […]

INJECTION OF LIST (JAVA COLLECTION) USING SETTER AND CONSTRUCTOR DEPENDENCY INJECTION

Posted Posted in Spring

In our previous tutorial we learned how to inject String, primitives, and objects using spring framework, In this tutorial, we will learn how to inject java collection java.util.List using Setter and Constructor Injection. Setter Injection using List values: In setter injection using a List, we define a tag <property name=”name of variable” > <list> <value>data 1</value> <value>data 2</value> <value>data n</value> […]

Dependency Injection in Spring Framework

Posted Posted in Spring

Dependency Injection in Spring Framework – Dependency Injection can be achieved by Spring Framework using XML configuration, pure JAVA based configuration and implicit bean discovery with Autowiring. Methods to implement Dependency Injection: Explicit configuration in XML. Explicit configuration in JAVA. Implicit bean discovery and Autowiring. Dependency Injection in Spring Framework using XML It’s one of the ways […]

What is Dependency Injection?

Posted Posted in Spring, Spring Core

Dependency Injection: It’s a design pattern in which we pass an object as an argument to a method or constructor of a class at run-time, rather than creating the object inside the constructor or method of a class, hence making our code loosely coupled. Note For Beginers: Don’t worry if you didn’t understand the above description, […]

What is Spring Framework

Posted Posted in Spring, Spring Core

Spring Framework is a Lightweight, Open source Application Container that supplies many features such as Dependency injection, AOP(Aspect Oriented Programming), Transaction management and much more to build a loosely coupled, Lightweight, Simple and Easily Testable java application. Note: Don’t worry if you didn’t understand the above description because of the terms like Application Container, Dependency […]