Timeline for Example of Data Oriented Design
Current License: CC BY-SA 3.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 15, 2015 at 17:02 | comment | added | Gurgadurgen | Your example is an example of standard OOP abstraction, and takes little to no advantage of DoD strategies. DoD is about the data, not about the model. The fact that you even have a "car" object is a dead giveaway that this isn't much of an example of DoD. A car is pretty specific, and DoD tends to do existence-based object composition and polymorphism, rather than inheritance-based. So, for example, you might have an object that holds information that is required for a specific transform, and make an array of those objects, instead of an object with information for multiple transforms. | |
| May 15, 2015 at 6:45 | comment | added | Tordin | This is more of an example, not an ultimate guide. you of course have to pick the best fitt for your own implementation. ( as it is stated ) | |
| May 13, 2015 at 13:25 | comment | added | Gurgadurgen | A few DOD issues: 1. Lose scale, for sure. Calculations regarding position & rotation are virtually always unaffected by scale, so it will pretty much never get used, and just take up cache space. 2. I'd also lose rotation, and replace it with velocity. A car is intended to move straight, but its velocity will ultimately determine its direction. The driver presses the gas petal, but physics moves the car. 3. Don't inherit from classes for the data if you don't plan on using it in almost all calculations, together. 4. Even in OOP, cars do not update each other. Use free functions. | |
| Dec 19, 2012 at 9:50 | history | answered | Tordin | CC BY-SA 3.0 |