lundi 3 août 2015

javax.json (JSR 353) vs org.json - long term preference, interoperability?

When writing new code, I am unsure whether it's better to use org.json or javax.json.

  1. Is one recommended over the other?
  2. Is there an easy way to convert between one library to the other (apart from serializing and deserializing)?

Pros and cons

javax.json

  • Implements JSR 353
  • supports the builder pattern for constructing objects & arrays and making immutable (desirable for functional programming style)
  • implements java.util.Collection interfaces

org.json

  • Has an (easier) way to pretty-print objects
  • is present in a lot of code bases already

Aucun commentaire:

Enregistrer un commentaire