Everything about

#dop

Many of the language features recently added to Java come together to support data-oriented programming - a programming paradigm first described for Java in June 2022 by Brian Goetz. This here is a proposal for a revised version 1.1.

Introduction

I wrote a series of posts that proposed an updated data-oriented programming version 1.1 and you should read them in the following order:

Image with slug dop-v1-1-introduction
Data-Oriented Programming in Java - Version 1.1#post#dop #architecture
Many of the language features recently added to Java come together to support data-oriented programming - a programming paradigm first described for Java in June 2022 by Brian Goetz. This here is a proposal for a revised version 1.1.
Image with slug dop-v1-1-immutable-transparent-data
Model Data Immutably and Transparently - Data-Oriented Programming v1.1#post#dop #records
To model data immutably and transparently is one of the four principles of data-oriented programming. In this article, we explore why immutability and transparency are important when modeling data and how to use Java's features, particularly records, to achieve that.
Image with slug dop-v1-1-model-data
Model Data, the Whole Data, and Nothing but the Data - Data-Oriented Programming v1.1#post#dop
Data-oriented programming (DOP) centers around modeling data as closely as possible and so a core principle of DOP is to 'model the data, the whole data, and nothing but the data'. This goal is best achieved with a mix of records and sealed types as well as some programming practices that may seem odd to the object-oriented developer - all of which is explored in this article.
Image with slug dop-v1-1-illegal-states
Make Illegal States Unrepresentable - Data-Oriented Programming v1.1#post#dop
Data-oriented programming focuses on modeling data as closely as possible and a guiding principle for achieving that is to ensure that the software can not represent illegal states. That can be achieved with good type design or with constructor checks (plus tests).
Image with slug dop-v1-1-separate-operations
Separate Operations From Data - Data-Oriented Programming v1.1#post#dop #pattern‑matching
Data-oriented programming guides us towards a separation of data and operations. Operations should be implemented in dedicated subsystems, using pattern matching over sealed interfaces to pick execution branches and deconstructing records to implement domain logic.
Image with slug dop-v1-1-wrap-up
When to use Data-Oriented Programming#post#dop #architecture
How does data-oriented programming compare to object-oriented and functional programming and what are good situations to start using it?
Image with slug dop-v1-1-why-update
Why Update Data-Oriented Programming to Version 1.1?#post#dop
A review of data-oriented programming version 1.1: What caused the update and what is still left to be improved?

More

There are a few more posts on the topic:

Image with slug java-21-pattern-matching
Java 21 Pattern Matching Tutorial#video#java‑21 #pattern‑matching #dop #java‑basics
Java 21 is the first Java release with all essential pattern matching features finalized: sealed types, type patterns, an improved switch, records, and record patterns. This tutorial puts them all together.
Image with slug talk-java-pattern-matching
Data-Oriented Programming - Version 1.1#talk#dop #pattern‑matching #project‑amber
Data-oriented programming models data as data: records for entities and sealed types for alternatives. Combined with pattern matching we can define operations on the data without overloading it with functionality.
Image with slug inside-java-newscast-33
Java 19 in Action - Inside Java Newscast #33#video#java‑19 #dop #project‑loom
Among other things, Java 19 ships with virtual threads, structured concurrency APIs, sealed types, and pattern matching in switch - all of them as previews, but still very cool! I'm using these features here to create a GitHub crawler.
Image with slug inside-java-newscast-29
Data-Oriented Programming - Inside Java Newscast #29#video#records #dop #pattern‑matching #patterns #techniques
Data-oriented programming focuses on modeling data as data (instead of as objects). Records for data and sealed types for alternatives let us model immutable data where illegal states are unrepresentable. Combined with pattern matching we get a safe, powerful, and maintainable approach to ad-hoc polymorphism that lets us define operations on the data without overloading it with functionality.