Doing software development since I can remember. Big fan of the JavaScript and Rust ecosystems. Long-time Java and JavaScript developer. Music producer wanna-be. ;)
Location
Warsaw, Poland
Work
Software Architect | Senior Full-stack Java/JS Developer at ISOLUTION
One thing though: when you take data deserialization into account (whether it's "JSON/XML/gRPC to object" or ORM), then only the enum-based solution truly works "out of the box". That of course is a basic scenario.
Luckily most solutions (JPA/Hibernate, Jackson, etc.) offer the possibility of implementing a custom deserializer (again, whether it's a data deserializer or a ORM converter), so with little effort you can implement other strategies as well.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nicely explained. :)
One thing though: when you take data deserialization into account (whether it's "JSON/XML/gRPC to object" or ORM), then only the enum-based solution truly works "out of the box". That of course is a basic scenario.
Luckily most solutions (JPA/Hibernate, Jackson, etc.) offer the possibility of implementing a custom deserializer (again, whether it's a data deserializer or a ORM converter), so with little effort you can implement other strategies as well.