Question

After looking at the core data type for frameworks that deal with unstructured data in java:

the common theme seems to be that data are first de-serialized into Map, then transformed into an given class by reflection.
So this raises the question, why not just work with these Map (or sub-type of map) directly? You can extend Map and create your own sub-type, and you will still have all the benefit of OO programming.

Edit I am not concerned with the cost of deserialization, but the flexibility that Map offers when dealing with unstructured data. By this, I mean not having to define a class that the data can be deserialized into.
Edit 2 I am more interested in the "why not (disadvantages)", since the framework I mentioned already demonstrated that it could be done.

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top