Dependency Injection

Dependency Injection: The Core

Reading Time: 4 minutes We can define Dependency Injection as a technique where one object supplies the dependencies to other objects. But what actually does it mean? Well, there are many answers to this question and sometimes they are quite confusing and annoying. But in this blog, I’ll try to keep things quite straightforward and as simple as possible. A class has a dependency on another class if it Continue Reading

Magic Of Dependency Injection in Angular 2

Reading Time: 3 minutes When i was a kid Injection word was my biggest nightmare, but since I have become a programmer and jovial by doing clean, crisp and precise applications the “injection” word seems the most wonderful word to me, as this word brings so much ease, reduces so much coding effort and helps us to build a project quickly. When I took Angular 2 to build my application then Continue Reading

Kick-Off Java 9 (Project Jigsaw & ServiceLoader) Part – II

Reading Time: 3 minutes Java  comes with major changes and new surprises for developers. Major changes came in  Java 5 and Java 8, but now Java 9 will come with new mysteries and changes. In the last post we were discussing about Java 9 with Jigsaw and in another post we were using ServiceLoader in Java instead of dependencies injections. Java 9 gives us a clean way for using Continue Reading

Play With Java ServiceLoader forget about Dependency Injection(DI) Frameworks

Reading Time: 2 minutes In most of the applications we are using Dependency Injection for loosely couple of our code. Some time, we just require simple DI, nothing else, for those, we need to include some of our DI frameworks like Spring, Google Guice etc. This makes our project jar heavy and added some unnecessary classes as well. For all these, Java itself have a ServiceLoader class for inject Continue Reading

Dependency Injection In Scala using Self Type Annotations

Reading Time: 5 minutes Dependency injection is a software design pattern that allows removing hard-coded dependencies and making it possible to change them, whether at run-time or compile-time. Dependency Injection has three kind of software components 1. Dependent or Consumer : Describe what software components, it depends on . 2. Dependencies on which consumer depends 3. Injector also known as provider : Decides what concrete classes satisfy the requirements Continue Reading