Closed GoogleCodeExporter closed 8 years ago
We describe explicitly that a JSON object in Java is a Map instead a HashMap.
We leverage the popular existing Map implementation HashMap to make JSONObject
simpler and let JSONObject focus on JSON encoding related stuff only. I think
"Favor composition over inheritance" is generally correct and is the best
practice for most cases, but I think in some special cases we can also use
inheritance reasonably base on our needs.
On the other hand, currently we don't force user to use JSONObject and user can
use any map implementation:
http://code.google.com/p/json-simple/wiki/EncodingExamples#Example_1-3_-_Encode_
a_JSON_object_-_Using_Map
Original comment by fangyid...@gmail.com
on 11 Jul 2010 at 4:11
Original issue reported on code.google.com by
uvico...@gmail.com
on 10 Jul 2010 at 5:08