Nicolai Parlog

Data-Oriented Programming - Version 1.1

What if your Java compiler could prevent invalid object states? See how Data-Oriented Programming uses sealed interfaces and pattern matching to make it a reality.

Data-Oriented Programming - Version 1.1
#1about 2 minutes

Introducing the four principles of data-oriented programming

Data-oriented programming (DOP) is a paradigm that models programs as a series of transformations on data, guided by four key principles.

#2about 5 minutes

Modeling a GitHub crawler page type example

An example of a GitHub crawler is used to explore how to model a complex page data type with various states and required operations.

#3about 2 minutes

Using Java records for immutable and transparent data

Java records are the ideal choice for modeling immutable data, and compact constructors can be used to ensure deep immutability for collection fields.

#4about 3 minutes

Modeling data alternatives using sealed interfaces and records

Sealed interfaces create a closed type hierarchy, allowing you to precisely model "either/or" relationships between different record types representing distinct data states.

#5about 3 minutes

How to make illegal data states unrepresentable

By combining a precise type hierarchy with validation in record constructors, you can prevent the creation of invalid object states within your domain model.

#6about 6 minutes

Separating operations from data using pattern matching

Operations are moved out of data records and implemented externally using switch expressions with pattern matching to deconstruct and act on the data.

#7about 4 minutes

Ensuring maintainability with compiler exhaustiveness checks

Switching over sealed types is safe because the compiler enforces exhaustiveness, issuing a compile error if a new subtype is added but not handled.

#8about 3 minutes

Comparing data-oriented programming to the visitor pattern

Data-oriented programming provides a more ergonomic alternative to the classic visitor pattern and is useful for modeling complex return types.

Related jobs
Jobs that call for the skills explored in this talk.

Software Engineer

tree-IT GmbH
Bad Neustadt an der Saale, Germany

Intermediate
Senior

Featured Partners

Related Articles

View all articles
BR
Benjamin Ruschin
What Developers Really Need to Create Great Code Demos
Every developer on earth has, at some point, had another developer to thank for a breakthrough, a success, an aha moment they wouldn’t have had without coming across that blog post, that open-source contribution, that reply on socials or that humble ...
What Developers Really Need to Create Great Code Demos
MI
Michael Inden
Modern Java Records
In this blog, I will present Records, one of my favorite features of modern Java. Records represent a simplified form of classes whose methods are implicitly derived from the attributes defined as constructor parameters. A record constitutes a collec...
Modern Java Records
BB
Benedikt Bischof
Using Java 17 latest features in real world projects
Welcome to this issue of the WeAreDevelopers Live Talk series. This article recaps an interesting talk by Ron Veen who introduced the audience to some of the most interesting features that got added to the Java language.About the speaker:Ron is a hig...
Using Java 17 latest features in real world projects
DD
Dilek Demir
Data Science & more: The Lopez dilemma
Catwalk, Data Science, Hollywood, Google Images, Haute Couture, StackOverflow, Comfort Zone, Dota 2 and Versace – all these topics are connected and influenced by each other. Read here how and why!In 2000 Jennifer Lopez's green Versace dress went vi...
Data Science & more: The Lopez dilemma

From learning to earning

Jobs that call for the skills explored in this talk.

Java Architect

Java Architect

Paradigma Digital
Municipality of Vitoria-Gasteiz, Spain

API
Java
Azure
Kafka
Agile Methodologies
+2
Data Architect

Data Architect

Paradigma Digital
Municipality of Madrid, Spain

ETL
Azure
NoSQL
Scala
DevOps
+5
Data Engineer

Data Engineer

Paradigma Digital
Municipality of Bilbao, Spain

GIT
Spark
Python
PySpark
Amazon Web Services (AWS)
+1
Data Engineer

Data Engineer

Paradigma Digital
Municipality of Vitoria-Gasteiz, Spain

GIT
Spark
Python
PySpark
Amazon Web Services (AWS)
+1
Data Scientist

Data Scientist

Paradigma Digital
Municipality of Vitoria-Gasteiz, Spain

Python
Machine Learning
Continuous Integration
Amazon Web Services (AWS)
Data Scientist

Data Scientist

Paradigma Digital
Municipality of Madrid, Spain

Python
Machine Learning
Continuous Integration
Amazon Web Services (AWS)
Data Scientist

Data Scientist

Paradigma Digital
Municipality of Valencia, Spain

Python
Machine Learning
Continuous Integration
Amazon Web Services (AWS)