Game engine design choice [closed]
I heard composition is preferable over inheritance. So when I design my simple game engine I tend to do the following: http://yuml.me/1252399d instead of: http://yuml.me/51cacb4f Is this a good approach, or should I reconsider? Edit: To clarify the notation. The arrows means inheritance, the arrows with a diamond means composition and the <<>> means interface. More info on the notation is available at the yUML webpage . OK, there are a few things to cover here. First: why do you need to express commonality between PointLight and Spotlight ? Is it Because there are clients who simply want to