Re: Existence Based Polymorphism
Richard Fabian <[email protected]>
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <[email protected]> |
On 3 June 2010 14:08, Stuart Golodetz <[email protected]> wrote: > Richard Fabian wrote: > > OO C++ Objects do represent something, but normally, they only represent > one thing. Data oriented approaches appreciate that data can be taken to > have different consequences or meanings just by looking at it from different > angles. If you lock yourself down to classes of data, you have to invent new > classes or transforms or both to represent all the non-standard* ways of > looking at that same data which adds layers of indirection to your code, and > possibly your thinking. If you never invent a class for the data, you merely > have to invent a view into it to begin to use it in the appropriate way. OO > C++ just seems to get in the way of simple transforms like this. > > > * where standard invariably == whoever drew up the class first > > It sounds like what you want is a model-view design pattern - which you can > do fine in C++. I guess I'm missing something obvious though? > > MVC is fine until you realise that you have data that either doesn't belong together in the same model, or belongs in multiple models. Objecting up your data still gets in the way of data repurposing. A number of times I've seen data re-generated just so that a different system can use the same data for a different purpose. I've seen floor plans converted into way grids, collision meshes, portal sections, and into the tile boundaries for texturing. Sometimes it almost made sense. using a model to bring other models together sounds like a solution to the problem, but then you're heading into a general headache of syncing all that stuff up. The point of the Model in MVC was that it was the owner of the data so became a one entry point for modifications and queries. Mixed up models, though solving the data repurposing just shunts the problem down a layer, so then you've got model being accessed by the model mixer (or Role if you like, see how I'm using new speak already), which is used in turn by one of the many views (3D render vs Map render) or controls (player input vs AI control) to make stuff visible, or happen. -- fabs(); Just because the world is full of people that think just like you, doesn't mean the other ones can't be right. _______________________________________________ Sweng-Gamedev mailing list [email protected] http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com