Hi, maybe what I want to ask you guys is pretty common in here. Recently, I've come upon a code of a class which has tons of inheritance like this:
Code:
class MainApp: public LayerManager, DisplayManager, SoundManager, AnimationManager
{
...
}
So the question is which is better between this "is a" approach with a "has a" Facade pattern approach that encapsulate the classes like this:
Code:
class MainApp
{
private:
LayerManager m_LayerManager;
DisplayManager m_DisplayManager;
SoundManager m_SoundManager;
AnimationManager m_AnimationManager;
public:
LayerManager getLayerManager();
DisplayManager getDisplayManager();
SoundManager getSoundManager();
AnimationManager getAnimationManager();
...
}
Just out of curiousity. Thanks in advance.