Click here to Skip to main content
15,889,808 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Dependency Injection mystery, and history... Pin
jmaida25-May-22 15:58
jmaida25-May-22 15:58 
GeneralRe: Dependency Injection mystery, and history... Pin
Super Lloyd25-May-22 17:08
Super Lloyd25-May-22 17:08 
GeneralRe: Dependency Injection mystery, and history... Pin
jmaida25-May-22 17:27
jmaida25-May-22 17:27 
GeneralRe: Dependency Injection mystery, and history... Pin
Niels Holst25-May-22 23:49
professionalNiels Holst25-May-22 23:49 
GeneralRe: Dependency Injection mystery, and history... Pin
Sander Rossel26-May-22 0:06
professionalSander Rossel26-May-22 0:06 
GeneralRe: Dependency Injection mystery, and history... Pin
Adam O'Neil26-May-22 5:16
Adam O'Neil26-May-22 5:16 
GeneralRe: Dependency Injection mystery, and history... Pin
raddevus26-May-22 5:09
mvaraddevus26-May-22 5:09 
GeneralRe: Dependency Injection mystery, and history... Pin
raddevus26-May-22 5:08
mvaraddevus26-May-22 5:08 
I think IoC/DI should all be explained with the simpler statement:

"Prefer composition over inheritance."

When I began learning OOP all the books, articles & gurus could talk about was Inheritance.
It even became one of the 3 Tenets of OOP (PIE - Polymorphism, Inheritance, & Encapsulation).

Inheritance was touted like crazy because people though it meant "REUSE!". It caused other problems.

So, then we saw a shift to "Prefer composition over inheritance" ala the Gang of 4 Book.

Composition simply meant build up a class from other classes.
But then, the challenge -- how do those internal classes get configured properly for construction.

Then came the DI which is very easy (pass it into the constructor).

But then, something happened. People wanted Frameworks to do this whole thing & then came THE GURUS to write books about those frameworks & aaaaaaahhh...... It all became so complicated so you had to buy a $50 book that would explain the framework to you.

That's my view of the whole thing.
The heart of "Prefer composition over inheritance" is a great principle to follow in some cases which makes for some really nice code. But all the other slopped on top of it, is blech! Dead | X|

And so it is in the IT / Development Community.
GeneralRe: Dependency Injection mystery, and history... Pin
Gerry Schmitz26-May-22 6:26
mveGerry Schmitz26-May-22 6:26 
GeneralRe: Dependency Injection mystery, and history... Pin
abmv26-May-22 8:05
professionalabmv26-May-22 8:05 
GeneralRe: Dependency Injection mystery, and history... Pin
MSBassSinger26-May-22 13:50
professionalMSBassSinger26-May-22 13:50 
GeneralRe: Dependency Injection mystery, and history... Pin
Member 1194113127-May-22 5:33
Member 1194113127-May-22 5:33 
GeneralA much needed vacation PinPopular
kmoorevs25-May-22 7:08
kmoorevs25-May-22 7:08 
GeneralRe: A much needed vacation PinPopular
Maximilien25-May-22 7:28
Maximilien25-May-22 7:28 
GeneralRe: A much needed vacation Pin
OriginalGriff25-May-22 7:56
mveOriginalGriff25-May-22 7:56 
GeneralRe: A much needed vacation Pin
devenv.exe25-May-22 8:31
professionaldevenv.exe25-May-22 8:31 
GeneralRe: A much needed vacation Pin
0x01AA25-May-22 8:56
mve0x01AA25-May-22 8:56 
GeneralRe: A much needed vacation PinPopular
Mike Hankey25-May-22 9:13
mveMike Hankey25-May-22 9:13 
GeneralRe: A much needed vacation Pin
dandy7225-May-22 11:07
dandy7225-May-22 11:07 
GeneralRe: A much needed vacation Pin
DRHuff25-May-22 13:54
DRHuff25-May-22 13:54 
GeneralRe: A much needed vacation Pin
Greg Utas25-May-22 15:33
professionalGreg Utas25-May-22 15:33 
GeneralRe: A much needed vacation Pin
kmoorevs26-May-22 6:10
kmoorevs26-May-22 6:10 
JokeSo I had to go to the store to get 6 bottles of Sprite... PinPopular
Sander Rossel25-May-22 1:16
professionalSander Rossel25-May-22 1:16 
GeneralRe: So I had to go to the store to get 6 bottles of Sprite... Pin
den2k8825-May-22 1:27
professionalden2k8825-May-22 1:27 
GeneralRe: So I had to go to the store to get 6 bottles of Sprite... Pin
Greg Utas25-May-22 1:29
professionalGreg Utas25-May-22 1:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.