Thoughts on software development
About SW by IT problems solver.
Ways to adhere to the OCP principle.
The OCP tells us to keep the class closed to modification and opened to extensions.
The first thing, that came up to my mind was to extend an abstract class.
However there are more ways to achieve the OCP compliant code.
Not to mention, that according to Gang of Four, "You should prefer decoration before extension" for classes.
To follow this we have several basic ways to work with classes:
- visitor
- delegation
- composition
- strategy
- state
The OCP in nutshell tells us that every new piece of functionality, should be achievable through extension of the affected holder of the logic and information.
The patterns mentioned above are special case of reification. You name a piece of functionality, give it life in the form of code and fling it together with class prepared to be extended in one way or another.
Studying REACT CONTEXT in the source code, I have not found any substantional use case, which couldn't be achieved by custom defined hook.
Guys, do you have some scenarion, in which CUSTOM React HOOK cannot replace React CONTEXT?
15/04/2022
Just have finished Refactoring For Software Design Smells.
Sometimes a book is sparking with ideas so much, that almost every line incurs some deep thought. This book is definitelly one of them. I was reading this book for 4 weeks in total. Not because it would be so boring, but because I was so immersed, that almost every chapter needed to be read at least twice, repeating the concepts over and over again.
Highly recommending.
11/03/2022
Just WOW
GitHub - giltayar/proposal-types-as-comments: ECMAScript proposal for type syntax that is erased - Stage 0 ECMAScript proposal for type syntax that is erased - Stage 0 - GitHub - giltayar/proposal-types-as-comments: ECMAScript proposal for type syntax that is erased - Stage 0
Klikněte zde pro získání vašeho sponzorovaného zápisu.
Kategorie
Internetová stránka
Adresa
Zálesí 29
Brno
79070