4 ms·
The problem he's attacking is very real, especially in game development - your objects don't obey a tree hierarchy, and diamond multiple inheritance is definite
by pmjordan 17y ago
The problem he's attacking is very real, especially in game development - your objects don't obey a tree hierarchy, and diamond multiple inheritance is definitely not the answer either. I'm not 100% sure I understand how he's implemented this, however. I'd be useful to see some more specific examples than the extremely abstract high-level diagram.
My approach was to introduce it in a stealth manner. I first discussed the idea with a couple of programmers individually, and eventually convinced them it was a good idea. I then implemented the basic framework for generic components, and implemented one small aspect of game object functionality as a component.
I then presented this to the rest of the programmers. There was some confusion and resistance, but since it was implemented and working there was not much argument.
This bit sounds familiar...
- stcredzero 17y agoSeems like the Go language's implementation of Interfaces would be very useful here!
- pmjordan 17y agoI've not looked into Go yet (I go on holiday and Google release a new language while I'm a away, hmph!) but if it's anything like Objective-C's 'protocols', it could work. You'd need to capture any messages and forward them to the appropriate component using some fast dispatching mechanism (hash table, I guess).