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:
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: public LayerManager, DisplayManager, SoundManager, AnimationManager { ... }
Just out of curiousity. Thanks in advance.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(); ... }



LinkBack URL
About LinkBacks




Misunderstanding on my part. The type of inheritance demonstrated in this post is ugly.