8000
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji
reacted with thumbs down emoji
reacted with laugh emoji
reacted with hooray emoji
reacted with confused emoji
reacted with heart emoji
reacted with rocket emoji
reacted with eyes emoji
Java Optionals in layered entities #199
hrstoyanov
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I created this test layered entity interface:
The generated code is:
The code is mostly OK (and it did not generate code for the default method, good!) but it would be nice to have the option to treat java Optional<>'s specially - basically take the raw objects as inputs, not their Optional wrappers. here is an example of generated code (data):
I think this can be achieved by some adding an annotation like
@OptionalGeneration(> (or something similar):
Such generated data objects would take less RAM (I think) and are more conformant with the recommended use of Optional<>'s, ... also, would that help with optimizing the serialization - how are optionals processed?
See :
https://medium.com/@muhammad.ahsan/java-optional-gist-of-tech-talk-by-stuart-marks-at-devoxx-790ae4565bde
https://nipafx.dev/java-optional-opinions/
https://nipafx.dev/intention-revealing-code-java-8-optional
Beta Was this translation helpful? Give feedback.
All reactions