Tomer Shaiman
1 min readOct 17, 2018

--

Nice ! it is always good practice to use Service Discovery either as “address” discovery, or as a proxy.
but , the idea behind DI relies further that just a Service Discovery mechanism. this concept is the “D” part in the S-O-L-I-D practice which states “Dependency Inversion” (not Injection as many think).
it is an OOP practice that helps to decouple application in a clean manner.
Yes , the event bus does that exactly ,but sometimes you do want to follow the DI pattern in order to inject different behaviours to classes, allow you code to be testable, and using some mocking framework to assist you with those IRepository objects (instead of building a pipeline for “test” purposes), assist you in replacing behaviours in runtime and many more goodies.
Good article !

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Tomer Shaiman
Tomer Shaiman

Written by Tomer Shaiman

Principal Software Engineer at Microsoft ✰ Kubernetes and DevOps ✰ CKAD/CKA Certified

Responses (1)

Write a response