| Random Link ¯\_(ツ)_/¯ | ||
| Sep 15, 2026 | » | OOP Concepts: Inheritance
2 min; updated Sep 15, 2026
Inheritance is a tool for sharing implementation where one class automatically gets the parent’s data and behavior, but at the cost of tight coupling. The “fragile base class” problem refers to the fact that any change in the parent can break every child. Modern languages and framework lean more towards composition and interfaces. An interface defines the behavior, and each class implements it independently. That is, abstraction and polymorphism without inheritance. ... |
| Sep 15, 2026 | » | OOP Concepts: Polymorphism
2 min; updated Sep 15, 2026
Polymorphism flows from abstractions. Once you define an interface like
Compare: … to: |
| Sep 15, 2026 | » | OOP Concepts: Abstraction
2 min; updated Sep 15, 2026
Abstraction means exposing only what’s essential and hiding implementation details behind clear interfaces. An abstraction hides complexity. Compare this lack of abstraction: … to: |
| Sep 14, 2026 | » | OOP Concepts: Encapsulation
1 min; updated Sep 14, 2026
Keep an object’s data private and let the object control how that data is used.
For example, the I’ve commonly encountered code like: … where the public getter and setter make the private member effectively
public. This comes from either cargoculting encapsulation, or intending to run
some code around setting/getting |
I initially had:
… but now we have
...IPaymentMethodconcerned withOrderobjects, when allIPaymentMethodshould care about is $$$.