Data Oriented Programming in Java 21 by Nicolai Parlog

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ม.ค. 2024
  • 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).
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 15

  • @techaido
    @techaido 3 หลายเดือนก่อน +1

    +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.

  • @abdulelahaljeffery6234
    @abdulelahaljeffery6234 4 หลายเดือนก่อน +2

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

  • @jayvkman
    @jayvkman 3 หลายเดือนก่อน +2

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

  • @bohdanchupika9237
    @bohdanchupika9237 3 หลายเดือนก่อน

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

  • @ktxed
    @ktxed 3 หลายเดือนก่อน

    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)

  • @nisachannel7077
    @nisachannel7077 4 หลายเดือนก่อน

    Awesome

  • @HeroDotus-db7ef
    @HeroDotus-db7ef 4 หลายเดือนก่อน

    nice

  • @etfexpectations-sectoroutl5323
    @etfexpectations-sectoroutl5323 3 หลายเดือนก่อน

    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.

  • @HermezTrimegisto
    @HermezTrimegisto 3 หลายเดือนก่อน

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

  • @mircdom4603
    @mircdom4603 หลายเดือนก่อน +1

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

  • @feloniousmonkey
    @feloniousmonkey 3 หลายเดือนก่อน

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

    • @nipafx
      @nipafx 3 หลายเดือนก่อน +5

      "This guy" here. Can you point at a few of those things? I want to make sure not to mislead new Java devs. 😉

    • @HermezTrimegisto
      @HermezTrimegisto 3 หลายเดือนก่อน

      Why this modafukas aren't clear? Why they want to show that they knows google knowledge?😅

    • @Brahvim
      @Brahvim หลายเดือนก่อน

      I hope my comment serves as a good guide for beginners, assuming that your comment is satirical!:
      Dynamic dispatch _is_ polymorphism, fellow internet stranger!
      You see, C++ programmers don't get this feature without an extra keyword (which notifies them that this feature is going to be used, which can sometimes be a bad thing for performance, hence it is a language feature).
      Imagine making an instance (an object!) of a subclass (so, a class that extends another) and calling a method on it.
      If this method was overridden by the subclass, then, _no matter_ what the type of the variable was, the method called would be the overridden version from the subclass.
      This happens because the compiler stores an extra table (called the "V-table", or in Java's case, the "I-table") along with EVERY OBJECT[!], to keep track of what version of a method should be called.
      Method calls that need the V-table are called "virtual calls" (because... we make the concept of an object "virtual", and go on to call methods that were not defined in the class the object is from, but were defined in other classes, because we used inheritance).
      Virtual calls are often avoided in data-oriented design (as shown in this talk, in the form of the separation of processing methods), because looking into a table is simply extra work we can avoid using a data-oriented design.
      To answer those wondering why a hierarchy for `Page` was used, well, please recall the fact that `Page` is a `record`, which means that the compiler is already making some optimizations for when they are used, and that the hierarchy exists only for pattern-matching, since we're using a sealed interface.
      _I hope this helps someone!_

  • @HermezTrimegisto
    @HermezTrimegisto 3 หลายเดือนก่อน

    I didn't learnt anything in this fuckin😂courze