Skip to content

This repository focused on dependency inversion && inversion of control (IoC) concepts in Java :octocat:

Notifications You must be signed in to change notification settings

TmaneChouaib/dependency-injection-exploration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DI - IoC Demo

🔎 Table of Contents :

📎 About :

  • 🏋️‍♂️ This lab demonstrates the concepts of dependency injection (DI) and inversion of control (IoC) in Java. It provides both a static and dynamic presentation of how dependencies can be injected into classes.

📎 Features :

  • Static Presentation: Use static instantiation to create instances of DOA and Business implementations and inject dependencies using setter methods.
  • Dynamic Presentation: Read configuration from a file and dynamically instantiate DAO and Business implementations based on class names specified in the config.txt file.
  • Interface Abstraction: Define contracts through the IBusiness and IDao interfaces for loose coupling and easy swapping of implementations.
  • Multiple Implementations: Support multiple implementations of IDao and IBusiness interfaces for retrieving data from different sources.
  • File Configuration: Configure the application behavior by specifying implementations in the configuration file config.txt, allowing for easy modification without code changes.

📎 Class Diagram : (DI/DIP) - Layer Structure :

📎 Project Structure:

dependency-injection-demo/
│
├── src/
│   ├── business/
│   │   ├── IBusiness.java
│   │   └── BusinessImpl.java
│   │
│   ├── dao/
│   │   ├── IDao.java
│   │   └── DaoImpl_A.java
│   │
│   ├── extension/
│   │   ├── DaoImpl_B.java
│   │   └── DaoImpl_C.java
│   │
│   ├── presentation/
│   │   ├── DynamicPresentation.java
│   │   └── StaticPresentation.java
│   │
│   └── Main.java
│
├── config.txt
└── README.md

📎 Contacts:

End


Author: Tmane Chouaib

About

This repository focused on dependency inversion && inversion of control (IoC) concepts in Java :octocat:

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages