Data-oriented design: Difference between revisions

Content deleted Content added
m Fixed grammar
Tags: Mobile edit Mobile app edit iOS app edit
His language no longer supports this functionality and it is not publicly released either.
Line 7:
== Contrast with object orientation ==
The claim is that traditional [[object-oriented programming]] (OOP) design principles result in poor data locality, more so if runtime polymorphism ([[dynamic dispatch]]) is used (which is especially problematic on some processors).<ref>{{cite web|title=What's wrong with Object-Oriented Design? Where's the harm in it?|url=http://www.dataorienteddesign.com/dodmain/node17.html}}describes the problems with virtual function calls, e.g., i-cache misses</ref><ref>{{cite web|title=Data-oriented design - why you might be shooting yourself in the foot with OOP|url=http://gamesfromwithin.com/data-oriented-design}}</ref> Although OOP does seem to "organise code around data", the practice is quite different. OOP is actually about organising [[source code]] around [[data type]]s rather than physically grouping individual fields and arrays in an efficient format for access by specific functions. Moreover, it often hides layout details under [[abstraction layer]]s, while a data-oriented programmer wants to consider this first and foremost.
 
== Programming languages ==
{{Primary sources section|date=April 2020}}
The experimental programming language [[Jonathan Blow#JAI language|JAI]] being developed by [[Jonathan Blow]] has explicit support for data-oriented design that eschews the traditional OOP paradigm. This is facilitated by being able to transparently move fields between [[Record (computer science)|records]] without extensive source code changes to functions using them (or without extensive [[boilerplate code]] to enable this), and by adding direct support for [[AOS and SOA#Structure of arrays|structure of arrays]] (SoA) data layout.<ref>{{cite web|title=Data-oriented demo:SOA,composition|url=https://www.youtube.com/watch?v=ZHqFrNyLlpA}}Demonstration of data-oriented and SOA features in the JAI language, also explaining the motives.</ref>
 
== See also ==
* [[AOS and SOA]]
* [[CPU cache]]
* [[Data-driven programming]]