component system (for GUI windows)
|Reported by:||Carsten||Owned by:||Carsten Fuchs <carsten.fuchs@…>|
In the forum thread at http://www.cafu.de/forum/viewtopic.php?f=6&t=1099, author "midix" suggested to use a "component system" for game entities in the Cafu Engine.
Whereas until now we used class hierarchies to introduce new features, component systems are a way to break the inherent limitations and inflexibility. Composing game entities of components to bring in new features in an additive manner removes the combinatorial complexity that exists with class inheritance, can improve encapsulation (features are encapsulated in components), and gives users both more flexibility and control.
The forum thread subsequently gathered a lot of additional and related information, see there for all the details.
During my research, it turned out that the windows of a GUI essentially profit from a component system as much as game entities do.
In Cafu we already have a pretty good GUI system with an existing class hierarchy for GUI windows. The window class hierarchy starts to suffer (mildly still) from the very problems that a component system is supposed to solve, and at the same time is much smaller than our game entity class hierarchy.
As we're still relatively new to component systems, at this time we cannot foresee all the ramifications and consequences or obligations that switching to a component system will bring. As such, the GUI window class hierarchy seems to be a very good field to introduce a component system to Cafu. It being both "small" but also seeing use in real life makes it the ideal ground for gathering experience, making experiments and learning more about it. The experiences gathered in the course of the implementation of this ticket are intended to facilitate the future migration of the game entities to a component system, too.
Therefore, the objective of this ticket is to introduce a component system that is supposed to replace the current GUI window class hierarchy.