Data Oriented Programming in Java 21 by Nicolai Parlog

preview_player
Показать описание
In data-oriented programming (DOP), we model data as data and polymorphic behavior with pattern matching. This talk will introduce the concept of DOP and its four principles:

- model the data, the whole data, and nothing but the data
- data is immutable
- validate at the boundary
- make illegal states unrepresentable

We'll also explore how to use pattern matching as a safe, powerful, and maintainable mechanism for ad-hoc polymorphism on such data that lets us define operations without overloading the types with functionality. The talk ends with a juxtaposition to OOP, so you not only learn how to employ DOP but also when (not).
Рекомендации по теме
Комментарии
Автор

it is always great to see concepts put into real example that can be translated into other similar abstractions and use cases

abdulelahaljeffery
Автор

+20 years ago DDD gave us VALUE OBJECTs to help us with immutability in OOP and now JAVA is given us Record, Thank you Team.

techaido
Автор

Been using this technique in Kotlin/Scala for a while and really like it, glad to see it finally land in Java.

jayvkman
Автор

Awesome video! I like the way you combined several features and explained them in the context of solving a real problem (crawling).

bohdanchupika
Автор

I found this talk did a good job of relating a lot of the new features and justifying them, which was very helpful when I then watched one of Brian Goetz's recent talks on new features in Java.

BangsarRia
Автор

For parallel programming immutability can become a problem. Especially when RAM is a constraint. What you often want is for several threads to work on different parts of the same array. Only 1 thread is working on a given part. So the immutability constraint gets in the way.

acasualviewer
Автор

Why this mofefokas aren't concise and clear, ?😅

HermezTrimegisto
Автор

31:31 must be able to add new types without touching existing code (open/closed principle)

TJ-hsqm
Автор

Is it functional? I am not familiar with FP. But it's definitely procedural. Uncle Bob mentions exactly this in his CC book.
And also mentions the tradeoff being made.


It general PP makes it cheap to add new behaviour but expensive to add new types. Imagine you want to add new GH page type, then you have to update all the methods, but you can keep the the old types intact. With OOP it's the opposite.

kalamatej
Автор

I see having error pages as a bit of an abuse. In this case I would introduce another hierarchy of Response-like objects that may wrap real pages (IssuePage, PrPage, etc) and provide HTTP layer response metadata (statuscode, headers, etc)

ktxed
Автор

Very interesting topic; thank you for posting it.

I don't like how the presentation shows the speaker and their screen at the same time. It's annoying to have to follow both.😞 And what's with the video's background;? What a waste of bandwidth; it could have been used to show more detail of the speaker's screens.

etfexpectations-sectoroutl
Автор

Just watch Mike Acton, unfortunately Brian Goetz got it wrong this time

mircdom
Автор

nice presentation. Also, he was funny why is not the audience laughing at all to his jokes??? L audience

aesh
Автор

You can actually apply DOP to big complex data calculations as well. Consider big games for example, where you have lots and lots of stuff transforming around the world. It's much more easier to use mental model of OOP to make this game world. But once you build it with DOP mindset, you would have no reason to switch back to OOP mindset. There is actually zero reason to not program in DOP mindset. Encapsulation - is not really a thing. You are hiding information from programmers, not from the actual program. The reality is that most of the time your incapsulated information will run on the same machine, same virtual memory, same process, etc. The only reason to consider encapsulation as a rule of thumb - is because of mental model culture, thinking that every object in your code is an isolated unit with hidden information, when in reality - it's not.
The core idea of DOP - is to utilize your CPU resources, with data vectorization(SOA), in/out functions that operate on the only data they need, parallelization.
I already like the idea that someone at least try to bring DOP into Java, because Java is so overloaded with OOP and natively inherits a lot of bad practices and brings a lot of "abstraction software engineers" into the life. Of course, it would be better if someone could upgrade Java and finally add manual memory managment, raw pointers, custom mallocs, heap/stack managment, maybe some compile time generation feature and still have high-level syntax. BUT again, the problem is that the language was originally architected around OOP mindset, so it would be easier to just make new language from that point.

cheerwizard
Автор

I didn't learnt anything in this fuckin😂courze

HermezTrimegisto
Автор

This guy continually calls things polymorphism which arent...I feel sorry for new java developers..

feloniousmonkey