Re: Software Architecture/Design
Tom Plunket <[email protected]>
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <[email protected]> |
> Tom Plunket wrote: >> >> Anyway- this is a very strange discussion to me, having been steeped >> in writing OO code in C, since obviously "the data knows nothing" and >> all of the transformations were functions that took an "object" and >> did some operation with it. Richard Fabian wrote: > > Sorry, forgot to comment on this bit earlier. > In my experience/understanding of OO, an object class is both a data > definition and the implementation of the methods that can be called on it. > An object instance is a self aware data construct. > From this definition, the closest you can approach dumb data is persisting > the type of the object somewhere other than the object's memory. It's still > object oriented, but code is branching on some other data store. > In your OO code in C, either your data did know something (i.e. it had a > type persisted somewhere that branched code dependent on the object) or it > wasn't object oriented. This is an interesting point and reframes the discussion somewhat. It's not about what operations are available on a bit of data, it's about making decisions about what operations to execute on the set of data. In otherwords, is the decision making done based on the inspection of the data being processed, or is that decision being made elsewhere? For this whole stream processing sub-thread, clearly there is no decision making going on when the data is being processed. The code is (ideally) not looking at the individual bytes and deciding what to do with the data, it's just ripping through the data doing the same transform on every "element," i.e. it's doing some operation on some data with a given stride. I still don't believe that it's an either/or question though. From my earlier example, you have a bunch of Cars that each have as a components an Engine. When processing an individual Car you're not going to reach into the injectors and squirt fuel into the cylinder, but that doesn't mean that you can't inspect specific Engines for some reason if it becomes necessary. Arranging your data for "stream processing" does not require that you can't access individual entries. Indeed- an "abstraction" of CarList or EngineList seems superfluous; you want things that operate on the chunk of data in one go, but you don't want a "heavyweight" object with lots of manipulators. Your bulk/primary processing is still going to be on single elements, the big change is that that processing doesn't make decisions per entry. That processing just does the transform on every item. -tom! -- _______________________________________________ Sweng-Gamedev mailing list [email protected] http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com