0 Principles of Data-Oriented Programming
Data-Oriented programming is a programming paradigm aimed to simplify the design and implementation of software systems where information is at the center. Instead of designing information systems around entities that combine data and code together (e.g. objects instantiated from classes), DO encourages us to separate code from data. Moreover, DO provides guidelines about how to represent and manipulate data.
The essence of DO is that it treats data a first class citizen. As a consequence, in Data Oriented programs, we manipulate data with the same simplicity as we manipulate numbers or strings in any other programs.
Tip
In Data Oriented programming, data is a first class citizen.
Treating data as a first class citizen is made possible by adhering to three core principles. This chapter presents at a high level the core principles of Data Oriented (DO) Programming.
The principles of Data Oriented (DO) Programming are:
- Separate code from data
- Represent data entities with generic data structures
- Data is immutable
- Separate data schema from data representation
When those 4 principles are combined together, they form a cohesive whole as shown in Figure 0.1, that allows us to treat data as a first class citizen. As a consequence, we improve our developing experience and makes the systems we build easier to understand.