The Object type of the platform is able to hold reference to both platform derived types (Lists, String, Structures, etc) and plain javascript objects. For this reason this can be used for many ends such has passing platform objects from action to action and even to javascript nodes.
Many times there's a need to pass some object/data to external javascript code with a specific structure and the current solutions that I am aware are:
- If the structure is known, manually create a javascript object with the desired structure and set the respected values
- Use JSON.stringify() on a platform Object and later JSON.parse(). This adds unnecessary overhead
- Same as previous but with serialize/deserialize actions from the platform
And when we want to get data from external code into platform's context types we have:
- A defined Structure that knows how to parse objects from JSON
My idea would be to have a pluggable system for type converters in a way that the user defines how a specific type should be converted from plain javascript to a platform type. This, coupled with http://www.outsystems.com/ideas/2878/interface-oriented-object-validation would make a powerful toolset.