We are evaluating DirectJNgine for server side stack for ExtJs 4.1 and we are not able to find answers of following queries in case of Json encoding decoding by using DJN:
- When we actually need to write our own Json encoding decoding code while we can easily use Ext.Data.DirectStore for directly sending client side data to server side and vice-a-versa.
- Is it necessary to write inner static class for serialization and deserialization for each of the complex object like UserDetail object in subclass of DefaultGsonBuilderConfigurator.java.
- Is it needed to write serialization-deserialization logic in inner static classes of the class that is subclass of the DefaultGsonBuilderConfigurator.java or we can write these logic in non static inner classes.
- Suppose we have written separate inner static classes for serialization and deserialization of two objects like Date and UserDetail and using these inner static classes in configure() method as follows:
And now in one of my request to server, I want to execute only date serilization and in other request I want to execute only UserDetail serialization. So, how it can be done? Should we have to use some if-else like conditions or DirectJNgine provides some built-in functionality to handle this type of situation?Code:builder.registerTypeAdapter( Date.class, new JsonDateSerializer() ); builder.registerTypeAdapter( UserDetail.class, new JsonUserDetailSerializer() );