5 Matching Annotations
- Jun 2023
-
stackoverflow.com stackoverflow.com
-
Public and/or protected fields are bad because they can be manipulated from outside the declaring class without validation; thus they can be said to break the encapsulation principle of object oriented programming.
-
- Feb 2021
-
en.wikipedia.org en.wikipedia.org
-
They claim that inheritance often breaks encapsulation, given that inheritance exposes a subclass to the details of its parent's implementation.
-
- Sep 2020
-
github.com github.com
-
The main reason using classes isn't a great solution is that it completely breaks encapsulation in a confusing way, the paren't shouldn't be dictating anything, the component itself should. The parent can pass things and the child can choose to use them or not but that is different: control is still in the hands of the component itself, not an arbitrary parent.
-
-
github.com github.com
-
This arguably breaks encapsulation (it's not encouraging you to only pass down custom properties, but any styles to an element you don't control), and is contingent on component authors handling it in a consistent way.
-
Personally, I think class is too blunt an instrument — it breaks encapsulation, allowing component consumers to change styles that they probably shouldn't, while also denying them a predictable interface for targeting individual styles, or setting theme properties globally
-