1 Data Oriented Programming

 

This chapter covers

  • Introducing Data-Oriented programming
  • Data as Data
  • How representation effects on our programs

This book is about data. What it is, how to think about it, how to model it, how to represent it in our code, and all the good things that happen when we do. Programs that are organized around the data that they manage tend to be simpler, smaller, and, most importantly, significantly easier to understand.

We’re going to learn how to model data “as data” using Java. Meaning data on its own, as ordinary values, independent of any class, operation, or behavior. We’ll still use those things throughout our programs, but at the heart of everything will be data, and its representation independent of any other code.

We lift data up to this lofty place because it means something within its domain and to the people that use it. Data is more than just a collection of values that gets shoveled around our programs. It’s more than that stuff inside of our objects. Data has a semantics which differentiates it from all the other data it could be. An integer can represent an infinite number of "somethings", but it's only within a particular domain that it becomes something meaningful like an age or population count. It’s by breaking out data on its own that we can focus on this semantic meaning. When we understand our data at a deep level, we unlock new expressive power in our programs.

1.1 Objects in a Data Oriented World

1.2 The soul of data-oriented programming in a single line:

1.3 Show me your data, and the rest will be obvious

1.4 Orienting around data

1.5 Which version of Java do I need?

1.6 How does this book teach?

1.7 Wrapping up

1.8 Summary