Random question: I have a JSON of a lot of kilobytes, already almost reaching the mega.
I'm about to make it Java-istic and I'm in a list map: Map<List<Map<List, OMG>>>> data
Or a full-fledged class:
Departamento {
Empleado {
Direccion {
String calle;
}
}
}
Etc. etc
The question is that you have to access some properties dynamically depending on the user interaction (example there is a combo with departments and if you choose HR, that is if it is Conta etc.)
With the map I do
Map<List<Map, ETC>>> depa = data.get( depaSeleccionadoPorElUsuarioEnUnCombo );
With the class I would have to use reflection ... right? true?
for ( Field f : data.getClass().fields ) {
if ( f.getName() == depaSeleccionaroporElusuarioEnUNCombo ) {
String value = f.invoke( o, whacha whacha);
}
I can use annotations but the subject is the same
Question: With everything and everything, it is significantly faster / slower to use a specific class and then reflection to access the content OR it is better to use the map of lists of maps of lists of lists of maps of etc. etc.
I'm starting to do a proof of concept for this, but if someone has already gone through there and has some information to advise.