-
Type:
Story
-
Status: Closed
-
Priority:
Minor
-
Resolution: Completed
-
Affects Version/s: 6.2.0 CE M5
-
Fix Version/s: 6.2.0 CE M5
-
Component/s: Portal Services, Portal Services > Legacy
-
Labels:None
-
Git Pull Request:
object2map
Currently, _convertObjectToMap method in JSONWebServiceInvokerAction does the following: serialize object and then deserialize it to a map. This is not so fast. There might be two better solutions:
- Add TypeAwareMap or TypeWrapperMap that wraps an object ie bean, and handle keys as bean properties
- Or simply copy all bean properties to a map, manually, on creation.
The first solution seems fine on the first sight, as it require less reflection usage (just for the properties that are needed). However, deserialization would fetch all map keys, i.e. all bean properties, so therefore I am leaning towards the second approach.
Just be careful to skip the excludes, as this is currently done automatically!!!
One more caveat: due to current serialization, all properties will be serialized as well - therefore, an int[] property will be serialized to List. This would change with this LPS; should not have any negative impacts.
object2list
The same thing applies to conversion of an object to a list (method _convertObjectToList. Currently, we do serialize an object and then deserialize it to list. This is expensive. Direct conversion is better solution.
Moverover, currently we support only List types. This story will expand support to arrays and collections in general; allowing service to return e.g. an array or hashset and still being able to filter it.