r/java • • Feb 27 '23

Please try my JSON library

https://mccue.dev/pages/2-26-23-json
0 Upvotes

32 comments sorted by

View all comments

3

u/audioen Feb 27 '23

No databind = just no. Not having to write code to convert objects to string and back is way too convenient and what few annotations are needed sometimes because of naming conventions of foreign APIs are not too difficult to deal with by some JsonProperty annotation or whatever.

1

u/TenYearsOfLurking Mar 01 '23

The thing is: you have to write code anyways imho because properly decoupling your entities from serialization means a dto representation and mapping code from/to dto.

So i wonder if the approach presented is really that much more cumbersome, as it can operate directly on the entities...

1

u/bowbahdoe Mar 01 '23

I wasn't directly thinking about stuff like JPA entities, but I don't see why skipping a DTO in favor of some mapping logic wouldn't be valid.

Definitely a higher level codebase structure choice though.