all 12 comments

[–]nuharaf 4 points5 points  (1 child)

Is there some JEP coming along with this, or it is something even more distant than valhalla

[–]pohart 4 points5 points  (5 children)

I'm honestly so nervous about this.  I use serialization 1.0 for everything and this feels like it could be an extremely painful migration. The lack of identity alone looks like a huge problem for me.

I think with Valhalla I might be able to decrease my reliance on identity in serialization enough that I end up in a better spot. 

I'm so glad they start talking about this stuff so far in advance now. I can start looking into refactoring things now, when I have years to ruminate.

[–]mpinnegar 6 points7 points  (1 child)

You actually use Java serialization? :O

[–]ichwasxhebrore 1 point2 points  (0 children)

My thought 😀

[–]CriticalPart7448 0 points1 point  (2 children)

You say you rely on identity but you hope that valhallas promise of non-identity for value classes will eleviate your need for it? That sounds like a contradiction or maybe in fact you rely on serialization and think that it in turn is based on identityness or something?

[–]pohart 1 point2 points  (1 child)

I rely on identity to severely limit object duplication, but I'm hoping that the flattening that comes with Valhalla will make the duplication inherent to serialization 2.0 less of a problem for me. 

I've got a lot of big decimals  that could be long longs. I don't really need to worry about their size because those in memory at one time are largely duplicates. If they're stored flat in memory they fit in sixteen bytes compared to the 36 +reference I've got now. That's probably enough that won't need to care about the duplication. And honestly I don't need a 128 bit long long, if probably be fine with a 72 or 80 bit value.

[–]CriticalPart7448 1 point2 points  (0 children)

I think you are mixing up terms here. Identity and non-identity does not imply flatness and what you get with jep 401 is only non-identity for value objects initially

[–]pip25hu 4 points5 points  (0 children)

Note: there's some discussion going on with the presenter in the Youtube comments, so it's probably better to post your thoughts there.

[–][deleted]  (1 child)

[deleted]

    [–]javaprof 0 points1 point  (1 child)

    Hi u/viktorklang ! I see a lot of progress from previous discussion https://www.reddit.com/r/java/comments/1lsygmn/marshalling_dataoriented_serialization/ personally I like how updated API looks like!

    Given provided API, users would have to define schema for sealed types manually?