Dependency injection in Spring

Introduction Here we will see different types of dependency injections in Spring framework. There are three types of dependency injections and they are constructor injection, setter injection and interface injection. Spring supports only constructor and setter injection. Interface injection is supported by other language like Avalon. Interface injection a different type of DI(dependency injection) that involves mapping items to inject to specific interfaces. Spring supports Setter Injection via Java bean setters; and Constructor Injection via constructor arguments. You may find useful tutorial on what is dependency pattern?

Continue

SOLID Design Principle Explained with Java

Introduction SOLID design principle is one of the most popular set of design principles in object-oriented software development. It’s a mnemonic acronym for the following five design principles: S – Single Responsiblity Principle O – Open Closed Principle L – Liskov Substitution Principle I – Interface Segregation Principle D – Dependency Inversion Principle

Continue

CDI (Context Dependency Injection)

Introduction I will discuss here about the Context Dependency Injection (CDI). First of all I will tell you what is Context Dependency Injection as follows. Context Dependency Injection (CDI): knit the web and transactional tiers together of the JEE platform is a set of services used together allows developers to use enterprise beans along with Java Server Faces (JSF) technology in web applications is desinged for use with stateful objects provides a great deal of flexibility to integrate various kinds of components in a loosely coupled but typesafe way

Continue

What is dependency injection

Dependency Injection Dependency injection is a software design pattern in which one or more dependencies (or services) are injected, or passed by reference, into a dependent object (or client) and are made part of the client’s state. The dependency injection pattern separates the creation of a client’s dependencies from its own behavior, which allows program designs to be loosely coupled and to follow the dependency inversion and single responsibility principles.

Continue