SlideShare a Scribd company logo
www.developersummit.com
Data-oriented programming in Java
Ron Veen
Who is Ron Veen
@ronveen
ronveen
@ronveen@foojay.social
● Java developer for 20+ years
● Special Agent @ Team Rockstars IT
● Speaker @ conferences
● Writing a book about Migrating to cloud-native Jakarta EE
Agenda
1. Evolution of traditional applications
2. Introducing data-oriented programming
3. Modern Java support for data-oriented programming
4. Examples of data-oriented programming with Java
Part 1 - Evolution of an application
Meet Pranav
Meet Pranav
A basic timesheet application
Bind users to projects
Bind users to projects
Bind activities to projects
Bind activities to projects
Introducing new types of users
Adding multi-tenancy
Even more functionality
Object-oriented programming
Identifying domains: User
Identifying domains: Timesheets
Identifying domains: Core-Data
Identifying domains: Authorization
Data-oriented programming
Part 2 - Introducing Data-Oriented Programming
Principles of data-oriented programming
● Separate data from logic
● Data is stored in generic data structures
● Data is immutable
● Data schema is separated from representation
Separate logic from data
● Code can be re-used in different contexts
● Testing in isolation
● Less complex systems
Data is stored in generic data structures
● Flexibele data model
● Use of generic functions that are not scoped to our data classes
Data is immutable
● Reference to the data may change, but not the actual values
● Returning new objects with different values
● Gives predictable behaviour
● Enabled safe concurrency
Separate the data schema from representation
● How to express the shape of your data
● XSD
● JSON Schema
Part 3 - Modern Java support for data-oriented programming
Modern Java support for data-oriented programming
● Records
● Sealed classes
● Pattern matching
● Switch functions for pattern matching
Records
Sealed classes
Pattern Matching
● Predicate
● Object to test against
● Pattern variables
● Flow scope
Pattern Matching: Instanceof
● Predicate ==> instanceof Approver
● Object to test against ==> user
● Pattern variables ==> a
● Flow scope ==> between { }
Pattern Matching: switch
Pattern Matching: record
Part 4 - Combining Java and data-oriented programming
Principles of data-oriented programming
● Separate data from logic
● Data is stored in generic data structures
● Data is immutable
● Data schema is separated from representation
Principles of data-oriented programming
● Separate data from logic
● Could be achieved by using static methods
● Not that different from how we use beans in Jakarta EE and Spring
Principles of data-oriented programming
● Data is stored in generic data structures
Principles of data-oriented programming
● Data is immutable
Principles of data-oriented programming
● Data schema is separated from representation
Principles of data-oriented programming
● Separate data from logic
● Data is stored in generic data structures
● Data is immutable
● Data schema is separated from representation
Alternative optional
Alternative optional
Alternative optional
Principles of data-oriented programming
● Model the data as data
● Data is immutable
● Validate at the boundary
● Make illegal states unrepresentable
Usage of data-oriented programming
Usage of data-oriented programming
Usage of data-oriented programming
Usage of data-oriented programming
Usage of data-oriented programming
Usage of data-oriented programming
Usage of data-oriented programming
Summary
● Data-oriented programming treats data as first-class citizens
● Data drives your application
● Java supports data-oriented programming via records, sealed classes and pattern matching
Questions

More Related Content

Similar to Data-oriented programming in Java - Developer Summit - Bangalore - 2023.pdf

Best Angular JS training in Hyderabad, India
Best Angular JS training in Hyderabad, IndiaBest Angular JS training in Hyderabad, India
Best Angular JS training in Hyderabad, India
N Benchmark IT Solutions
 
Modern Java - WeAreDevelopers - Berlin - 2023 - Ron Veen.pdf
Modern Java - WeAreDevelopers - Berlin - 2023  - Ron Veen.pdfModern Java - WeAreDevelopers - Berlin - 2023  - Ron Veen.pdf
Modern Java - WeAreDevelopers - Berlin - 2023 - Ron Veen.pdf
RonVeen1
 
Building Data Products with Python (Georgetown)
Building Data Products with Python (Georgetown)Building Data Products with Python (Georgetown)
Building Data Products with Python (Georgetown)
Benjamin Bengfort
 
MongoDB for Spatio-Behavioral Data Analysis and Visualization
MongoDB for Spatio-Behavioral Data Analysis and VisualizationMongoDB for Spatio-Behavioral Data Analysis and Visualization
MongoDB for Spatio-Behavioral Data Analysis and Visualization
MongoDB
 
Spring Data Neo4j: Graph Power Your Enterprise Apps
Spring Data Neo4j: Graph Power Your Enterprise AppsSpring Data Neo4j: Graph Power Your Enterprise Apps
Spring Data Neo4j: Graph Power Your Enterprise Apps
GraphAware
 
Introductio to Data Science and types of data
Introductio to Data Science and types of dataIntroductio to Data Science and types of data
Introductio to Data Science and types of data
ManishaPatil932723
 
Vinod Krishnan Ramakrishnan
Vinod Krishnan RamakrishnanVinod Krishnan Ramakrishnan
Vinod Krishnan RamakrishnanVinod Krishnan
 
20150814 Wrangling Data From Raw to Tidy vs
20150814 Wrangling Data From Raw to Tidy vs20150814 Wrangling Data From Raw to Tidy vs
20150814 Wrangling Data From Raw to Tidy vsIan Feller
 
A compute infrastructure for data scientists
A compute infrastructure for data scientistsA compute infrastructure for data scientists
A compute infrastructure for data scientists
Stitch Fix Algorithms
 
Architect’s Open-Source Guide for a Data Mesh Architecture
Architect’s Open-Source Guide for a Data Mesh ArchitectureArchitect’s Open-Source Guide for a Data Mesh Architecture
Architect’s Open-Source Guide for a Data Mesh Architecture
Databricks
 
Mobile Offline First for inclusive data that spans the data divide
Mobile Offline First for inclusive data that spans the data divideMobile Offline First for inclusive data that spans the data divide
Mobile Offline First for inclusive data that spans the data divide
Rob Worthington
 
Building Data Apps with Python
Building Data Apps with PythonBuilding Data Apps with Python
Building Data Apps with Python
Benjamin Bengfort
 
Object Oriented, Design patterns and data modelling worshop
Object Oriented, Design patterns and data modelling worshopObject Oriented, Design patterns and data modelling worshop
Object Oriented, Design patterns and data modelling worshop
Mohammad Shawahneh
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Knoldus Inc.
 
LODFlow: Workflow Management System for Linked Data Processing
LODFlow: Workflow Management System for Linked Data ProcessingLODFlow: Workflow Management System for Linked Data Processing
LODFlow: Workflow Management System for Linked Data Processing
Ivan Ermilov
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
Knoldus Inc.
 
Deep Recommender systems - Shibsted, Oslo
Deep Recommender systems - Shibsted, OsloDeep Recommender systems - Shibsted, Oslo
Deep Recommender systems - Shibsted, Oslo
Max Pumperla
 
Resume_Informatica&IDQ_4+years_of_exp
Resume_Informatica&IDQ_4+years_of_expResume_Informatica&IDQ_4+years_of_exp
Resume_Informatica&IDQ_4+years_of_exprajarao marisa
 
Aayush Sinha_8.4Yrs_PO_BA
Aayush Sinha_8.4Yrs_PO_BAAayush Sinha_8.4Yrs_PO_BA
Aayush Sinha_8.4Yrs_PO_BAaayush sinha
 

Similar to Data-oriented programming in Java - Developer Summit - Bangalore - 2023.pdf (20)

Best Angular JS training in Hyderabad, India
Best Angular JS training in Hyderabad, IndiaBest Angular JS training in Hyderabad, India
Best Angular JS training in Hyderabad, India
 
Modern Java - WeAreDevelopers - Berlin - 2023 - Ron Veen.pdf
Modern Java - WeAreDevelopers - Berlin - 2023  - Ron Veen.pdfModern Java - WeAreDevelopers - Berlin - 2023  - Ron Veen.pdf
Modern Java - WeAreDevelopers - Berlin - 2023 - Ron Veen.pdf
 
Building Data Products with Python (Georgetown)
Building Data Products with Python (Georgetown)Building Data Products with Python (Georgetown)
Building Data Products with Python (Georgetown)
 
MongoDB for Spatio-Behavioral Data Analysis and Visualization
MongoDB for Spatio-Behavioral Data Analysis and VisualizationMongoDB for Spatio-Behavioral Data Analysis and Visualization
MongoDB for Spatio-Behavioral Data Analysis and Visualization
 
Spring Data Neo4j: Graph Power Your Enterprise Apps
Spring Data Neo4j: Graph Power Your Enterprise AppsSpring Data Neo4j: Graph Power Your Enterprise Apps
Spring Data Neo4j: Graph Power Your Enterprise Apps
 
Introductio to Data Science and types of data
Introductio to Data Science and types of dataIntroductio to Data Science and types of data
Introductio to Data Science and types of data
 
Vinod Krishnan Ramakrishnan
Vinod Krishnan RamakrishnanVinod Krishnan Ramakrishnan
Vinod Krishnan Ramakrishnan
 
20150814 Wrangling Data From Raw to Tidy vs
20150814 Wrangling Data From Raw to Tidy vs20150814 Wrangling Data From Raw to Tidy vs
20150814 Wrangling Data From Raw to Tidy vs
 
A compute infrastructure for data scientists
A compute infrastructure for data scientistsA compute infrastructure for data scientists
A compute infrastructure for data scientists
 
Architect’s Open-Source Guide for a Data Mesh Architecture
Architect’s Open-Source Guide for a Data Mesh ArchitectureArchitect’s Open-Source Guide for a Data Mesh Architecture
Architect’s Open-Source Guide for a Data Mesh Architecture
 
Mobile Offline First for inclusive data that spans the data divide
Mobile Offline First for inclusive data that spans the data divideMobile Offline First for inclusive data that spans the data divide
Mobile Offline First for inclusive data that spans the data divide
 
Building Data Apps with Python
Building Data Apps with PythonBuilding Data Apps with Python
Building Data Apps with Python
 
Object Oriented, Design patterns and data modelling worshop
Object Oriented, Design patterns and data modelling worshopObject Oriented, Design patterns and data modelling worshop
Object Oriented, Design patterns and data modelling worshop
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
LODFlow: Workflow Management System for Linked Data Processing
LODFlow: Workflow Management System for Linked Data ProcessingLODFlow: Workflow Management System for Linked Data Processing
LODFlow: Workflow Management System for Linked Data Processing
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Deep Recommender systems - Shibsted, Oslo
Deep Recommender systems - Shibsted, OsloDeep Recommender systems - Shibsted, Oslo
Deep Recommender systems - Shibsted, Oslo
 
Resume_Informatica&IDQ_4+years_of_exp
Resume_Informatica&IDQ_4+years_of_expResume_Informatica&IDQ_4+years_of_exp
Resume_Informatica&IDQ_4+years_of_exp
 
CV_Gajalakshmi_K_2015
CV_Gajalakshmi_K_2015CV_Gajalakshmi_K_2015
CV_Gajalakshmi_K_2015
 
Aayush Sinha_8.4Yrs_PO_BA
Aayush Sinha_8.4Yrs_PO_BAAayush Sinha_8.4Yrs_PO_BA
Aayush Sinha_8.4Yrs_PO_BA
 

Recently uploaded

Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 

Recently uploaded (20)

Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 

Data-oriented programming in Java - Developer Summit - Bangalore - 2023.pdf