---
title: "Discussion on \"So what's dependency injection?\" | Hashnode"
description: "Discussion on \"So what's dependency injection?\". Consider this situation, a class named EmployeeList which reads a list of employee names from files\npublic class Employee {\n     ...\n\n     List<Employee> getEmployeesJoinedAfterYear(int year) {\n        String content = readFromFile(\"employees.txt\");\n..."
url: "https://hashnode.com/posts/so-whats-dependency-injection/5f42b54682f012743b26a4a6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [So what's dependency injection?](https://blog.commitbyte.com/so-whats-dependency-injection?utm_source=hashnode&utm_medium=feed)

Consider this situation, a class named EmployeeList which reads a list of employee names from files public class Employee { ... List<Employee> getEmployeesJoinedAfterYear(int year) { String content = readFromFile("employees.txt"); ...

Aug 23, 2020 · 4 min read · blog.commitbyte.com  
Updated Dec 13, 2020  
Read the article

-   [#2articles1week](https://hashnode.com/tag/2articles1week)
-   [#design-patterns](https://hashnode.com/tag/design-patterns)
-   [#dependency-injection](https://hashnode.com/tag/dependency-injection)
-   [#java](https://hashnode.com/tag/java)

## Written by

[Santhosh Manikandan Soundararajan](https://hashnode.com/@santhoshmanikandan)

@santhoshmanikandan · Chennai, India

  
[View profile](https://hashnode.com/@santhoshmanikandan)

Java/Shell Script developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
