this post was submitted on 30 Jan 2026
580 points (97.4% liked)
Programmer Humor
29000 readers
1364 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Only if you're going by the strict UML definition of composition, which doesn't really apply here, since the industry has moved on a bit since UML was king.
Either way, you can use DI to do composition in the strictest UML way, provided every single dependency is transient and creates a new instance every single time. Even then though, when most devs talk about composition, they aren't referring to the strict UML definition.