Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
This is why nearly everything I deserialize is Optional 😉 trust is low.
@SortOfTested you mean storing nulls in modal?
Ugh i can't seem to find myself satisfied with this approach. if nulls are coming from the api, they are stored as nulls in the modal which will eventually get stored as null in some db somewhere.
apps are usually powered by db data and most of the time we will have to specifically handle null cases for data. i don't like handling those cases and therefore store the messages directly in the modal (for eg my person.email should be directly returning either the email or "Sorry, the email of this user is not available"" , which is the exact same message displayed in the ui)
No, just typing the value as Optional in the record so that the null handling is mandatory. Jackson will take some value T and deserialize it into Optional.of(value).
When dealing with external data, you oftentimes end up having to handle Byzantine faults.
Lor-inc491745d@2Large Idk about your framework, but if something isn't known then the only proper thing to put in the DB is a null, because the database can't mandate a specific way to handle nulls.
arekxv96444dI don't understand the stigma of nulls. It just means absence of a value and has many many many uses. Also every real world api sucks and its bad so you just have to accept it and deal with it on conversion phase.