Open Chealer opened 1 year ago
The following table might help in the difference between org.json and javax.json
org.json | javax.json | |
---|---|---|
Package | org.json |
javax.json |
JSON Processing API Version | N/A (Not a formal API) | Java API for JSON Processing (Version 1.1) |
Parsing | Provides a simple and flexible JSON parser | Provides a streaming and object model JSON parser |
Writing | Supports writing JSON objects and arrays | Supports writing JSON objects and arrays |
Size | Lightweight | Standard (part of Java EE and Java SE) |
Dependencies | Standalone library, no external dependencies | Part of Java EE and Java SE, no external dependencies |
Streaming | Does not support streaming JSON processing | Supports streaming JSON processing |
Conformance | May not fully conform to the JSON standard | Fully conforms to the JSON standard |
Performance | Generally considered slower | Generally considered faster |
Popularity | Widely used, especially in older Java projects | Gaining popularity, recommended for new projects |
@madhavgupta2011 Thank you, this is very helpful. I will look into incorporating this into the docs part of the project. Looks like streaming support and Conformance needs to be worked on. Generally considered slower? Really?
The following table might help in the difference between org.json and javax.json
I'm not sure I'd agree with a lot of that comparison.
@stleary @johnjaylward let me revise that table and send it when I get time. Thank you.
Please, add the license in comparision table. JSON-Java is released as public domain, Jakarta JSON Api is released with Eclipse and GPL+ GNU Classpath Exception
@stleary difference between org.json and javax.json already discussed in the previous post, anything else i can do here as a beginner
@lalithabourishetty-commits Please create a file called library-comparison.md
in the docs
directory and populate it with the contents of the post by @madhavgupta2011 . Incorporate updates from the posts by @Chealer, @johnjaylward, and @henryx. If you want to include any other libraries in the comparison, that would be great too. You should use GitHub markdown
to mark up the text.
@stleary while trying to clone forked repo facing access issue, any permission do i need ?
just ignore above
@stleary :
Generally considered slower? Really?
I found this JSON library benchmark comparison project: https://github.com/fabienrenaud/java-json-benchmark
The results in the of the benchmark are displayed as graphs in the Readme. Based on this benchmark org.json is at the lower end, compared to other optimised libraries.
Our team needs to receive and send JSON and wants to use a JSON library to facilitate that. org.json provides org.json.JSONObject while javax.json-api provides javax.json.JsonObject. The purposes of both libraries are clearly similar, and while there are obvious differences like licencing (this one is public domain), it takes time for evaluators to determine how to choose between these 2 options. And there are more, including Gson and Jackson.
Please provide a comparison, either as a feature table or as free-form text to help making a choice. If a third-party offers a neutral comparison, linking to it could suffice. If not, creating a comparison which focuses on comparing to javax.json-api would already be a good start. I would prioritize listing advantages of org.json, whether in terms of performance, flexibility or simplicity, but disadvantages would also help greatly.
A few resources already help: