You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2008/01/18 02:01:04 UTC

Aegis and those pesky arrays and Javascript

The ArrayOf types sure look clumsy in JavaScript.

I'm considering making the JS code generator recognize them and flatten
them out. That is, when an element is of type ArrayOfSomething, the
accessor would return a JavaScript array, not an object with a property
with an array value.

Problem is, how should the code decide when it's looking at one of
these? Could Aegis grow a schema extension to mark these guys? Else, I
can't think of much better than to look for the ArrayOf name pattern,
perhaps with a safety check for the structure of the complex type.

In case this isn't clear, the general problem is that each element in
the schema corresponds to a property in Javascript. So, the ArrayOf
types result in an extra level of indirection through an extra property.

On the other hand, this would cause a lot of complex chaos in the
serialization, and my time would better be spent on the flat= attribute
in aegis.