Dependency Injection
Dependency injection is a design pattern in which an object's dependencies are provided to it from the outside, typically by a framework or container, rather than the object creating those dependencies itself.
23 resources across 4 libraries
Glossary Terms(10)
Interfaces
An interface defines a contract of methods and properties that a class or object must implement, specifying what operations are available without dictating how…
Dependency Injection
Dependency injection is a design pattern in which an object's dependencies are provided to it from the outside, typically by a framework or container, rather t…
Inversion of Control
Inversion of control (IoC) is a design principle in which the flow of control in a program is handed over to a framework or external system, rather than the ap…
Singleton Pattern
The Singleton pattern is a creational design pattern that restricts a class to a single instance and provides a global point of access to that instance.
Factory Pattern
The Factory pattern is a creational design pattern that delegates object creation to a dedicated method or class, so calling code can obtain new instances with…
Strategy Pattern
The Strategy pattern is a behavioral design pattern that defines a family of interchangeable algorithms, encapsulates each one behind a common interface, and l…
Repository Pattern
The Repository pattern is an architectural pattern that mediates between the domain/business logic and data mapping layers, exposing a collection-like interfac…
Hexagonal Architecture
Hexagonal architecture, also known as Ports and Adapters, is a software architecture pattern that isolates an application's core business logic from external c…
Clean Architecture
Clean Architecture is a software architecture pattern, described by Robert C. Martin, that organizes code into concentric layers with dependencies pointing str…
Onion Architecture
Onion Architecture is a software architecture pattern, introduced by Jeffrey Palermo, that arranges application layers in concentric rings around a central dom…
Study Notes(1)
Cheat Sheets(1)
Interview Questions(11)
What is the Singleton Pattern?
The Singleton pattern restricts a class to exactly one instance and provides a single global access point to that instance, typically via a static method.
What is Dependency Injection?
Dependency injection is a technique where an object receives its dependencies from an external source rather than creating them itself, typically via construct…
What is Coupling and Cohesion in OOP?
Coupling measures how dependent one module or class is on another, while cohesion measures how strongly the responsibilities inside a single module belong toge…
What is the Dependency Inversion Principle?
The Dependency Inversion Principle (the 'D' in SOLID) states that high-level modules should not depend on low-level modules — both should depend on abstraction…
What are the Types of Dependency Injection?
There are three main types of dependency injection: constructor injection (dependencies passed into the constructor), setter injection (dependencies assigned t…
Constructor Injection vs Setter Injection
Constructor injection supplies dependencies as constructor parameters so an object is fully and immutably initialized the instant it is created, while setter i…
What is an IoC Container?
An IoC (Inversion of Control) container is a framework component that creates objects, resolves their dependencies, and manages their lifecycle automatically,…
Dependency Injection vs Service Locator
Dependency injection has an external party push required collaborators into an object, typically via its constructor, so dependencies appear explicitly in the…
What is Inversion of Control?
Inversion of Control (IoC) is the design principle where a program’s flow of control, including object creation and the wiring of collaborators, is handed to a…
What is a Tightly Coupled System?
A tightly coupled system is one where classes or modules depend heavily on each other’s concrete internal details, so a change in one nearly always forces a ch…
What is a Loosely Coupled System?
A loosely coupled system is one where classes interact through stable abstractions like interfaces rather than concrete implementations, so a class can be swap…