0 Principles of Data-Oriented Programming

 

0.1 Introduction

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]  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:

  1. Separate code from data
  2. Represent data entities with generic data structures
  3. Data is immutable
  4. 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.

Figure 0.1. The principles of Data Oriented programming
do principles journey

0.2 DO Principle #1: Separate code from data

0.2.1 The principle in a nutshell

0.2.2 Illustration of Principle #1

0.2.3 Benefits of Principle #1

0.2.4 Price for Principle #1

0.2.5 Wrapping up

0.3 DO Principle #2: Represent data entities with generic data structures

0.3.1 The principle in a nutshell

0.3.2 Illustration of Principle #2

0.3.3 Benefits of Principle #2

0.3.4 Price for Principle #2

0.3.5 Wrapping up

0.4.5 Wrapping up

sitemap