Funny, I saw at least two posts this week, with code that contains those exact InputComponent and MovementComponent classes. Looks like they all have been drinking the kool aid served by the same arch-speculative generalizator dude.
The first lesson that should be taught to any budding object-orienteer is Occam’s Razor. It should be the main governing principle when designing object oriented software systems.
Sadly it’s rarely mentioned at all when fancy concepts and terminology like “SOLID”, “encapsulation” or “design patterns” are tossed around. The Razor is centuries old and battle-proven across many scientific fields. There’s a reason it survived that long - it works!
Never introduce entities if they are not necessary. Never use a more complex device or concept than needed. If a function can do it, don’t introduce a class. If a code block can do it, don’t introduce a function. If reducing code can do it, don’t add code.
It’s also applicable to names. When I see a word “Component” (or “Manager”, “Factory” etc…) in class names I know problems are lurking down the road. It’s just pure redundancy for no other reason than wanting one’s code to appear more “knowledgeable”.
Godot has, what, about 100 node classes. How many of those node classes you see having the word Node in their names? Only 3 at the very root of the class hierarchy. Would you enjoy the company of AnimatableBody3DNode, Camera3DNode, Sprite2DNode, HBoxContainerNode… Of course not. You’d scream “Enough with this node node node thing already, we know it’s a node!” Same for Resource classes. Only a single base class is called Resource. There’s no ImageTextureResource or NavigationPolygonResource
Strive to design systems that look and operate stupidly simple, not intelligently complex. Beginners doing OOP often look like kids pretending to be grown ups, aping the appearance of those strange complicated “grown up” things without really understanding them. It always looks uncanny and they cannot fool anyone. If you’re a kid - do kid stuff first and foremost. And many times the grown ups benefit from doing kid stuff as well.
In systems design, the objective metrics of complexity are the absolute number of encapsulated boxes and, more importantly, the number, length and entanglement of communication noodles stretched between them, also known as spaghetti.
Have you started using again lately? I mean LLMs for making posts.