Harnessing Java 21 for Data Oriented Programming

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2024

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

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

    I loved Brian's article, too few people know about the sealed interface with multiple records inside it tidbit.

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

      Agreed. First time I saw the records inside the sealed interface, I thought it was a typo :⁠-⁠)

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

    Looks almost like Rust, nice😀One more thing that I love about records is using record patterns to deconstruct their values, e.g.
    case Result.Success(var astronautsByCraft) -> processor.printResults(astronautsByCraft) or
    case Result.Failure(var error) -> System.out.println("Error: " + error);

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

      Nice example of record patterns, thanks. As for Rust, never heard of it 😉

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

    very interesting how you did the sealed interface with two records inside

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

      Cool, right? Brian Goetz did it in his article and I didn't even realize that was legal until I saw him do it :⁠-⁠)

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

    your content is very good

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

    Excellent video with plenty detail explanation.
    I do have one question though: With realtime systems we used to say - stay away from new object creations as much as possible. With records you do not have an option to adjust the data other than creating a new record, like you did in the beginning. With the improved GC's and serious horsepower we have nowadays, do you think it is still better to use a DTO with getter/setter and pass that around, or use records and simply return a new instance when you do need to adjust some data.
    Personally I find using records great as input and output carriers, and old-school DTO's inside the app between different services/layers (old old habits die hard!). As always not a hard rule.

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

      Yeah, that's a legitimate debate. A lot of it comes down to immutability being so useful when concurrency is involved, because shared mutable state is so hard to get right. But I understand your concern

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

    Looking this amazing example I question myself why the hell Java did not bring the either interface of Scala. It would make so powerful.

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

    Not better. More efficient. 🤔 OOP foundation remain the same which make programming easier to manage. We tested these in my Data Analysis Course. The majority approved this conclusion. 😊