4 ms·
For the first two principles... in OOP they are just guidelines operating at the layer of business logic. There are programming languages/styles that implement
by crimsonalucard 7y ago
For the first two principles... in OOP they are just guidelines operating at the layer of business logic. There are programming languages/styles that implement these "principles" as laws all the way down to primitive components.
For DI:
https://news.ycombinator.com/item?id=19910450 https://news.ycombinator.com/item?id=19910450
See what I wrote about composition. I also have an example about a Car and engine class later in the thread.
Function Composition > Dependency Injection.
> ...I agree with your comments on Liskov Substitution Principle, that the fact it's even possible is a weakness in OOP type systems.
It's not actually a weakness in the type system. It's the weakness in the language. The language should never allow for such types to be constructed. Basically Inheritance is not compatible with the type checker. You get rid of inheritance, you get rid of this problem.