Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 1.48 KB

dop-intro.adoc

File metadata and controls

68 lines (47 loc) · 1.48 KB

Data-Oriented Programming

What is DOP?
A Lengthy Example
That was DOP!

Programming Paradigms

The goal of any programming paradigm is to manage complexity.

  • complexity comes in many forms

  • not all paradigms handle all forms equally well

⇝ "It depends"

Object-Oriented Programming

Everything is an object

  • combines state and behavior

  • hinges on encapsulation

  • polymorphism through inheritance

Works best when defining/upholding boundaries.

Note
  • maintenance boundaries

  • versioning boundaries

  • encapsulation boundaries

  • compilation boundaries

  • compatibility boundaries

  • security boundaries

Mixed Programming

Great use cases for OOP:

  • boundaries between libraries and clients

  • in large programs to enable modular reasoning

Consider a data-oriented approach for:

  • smaller (sub)systems

  • focused on data

Guiding principles:

Brian Goetz formulated them in June 2022:
Data Oriented Programming in Java

I offered an updated version in May 2024:
Data Oriented Programming in Java - Version 1.1

Data-Oriented Programming

Version 1.1:

  • Model data immutably and transparently.

  • Model the data, the whole data,
    and nothing but the data.

  • Make illegal states unrepresentable.

  • Separate operations from data.