[xsd-users] Example of Anonymous Types

Boris Kolpackov boris at codesynthesis.com
Fri Jun 1 12:50:08 EDT 2007


Hi Lester,

Lester Memmott <lmemmott at yahoo.com> writes:

> So in summary, the bulk of the code is the same between between
> named-types vs anonymous types (morph on) and anonymous types
> (morph off).  The only part that gets tricky is knowing how to
> declare the objects and the iterators.  You'll note that in the
> case with morph off the iterator type name gets rather long.

Another, a more serious problem, in leaving anonymous types is
the potential code bloat. Consider, for example, this schema:

<element name="foo">
  <complexType>
    ...
  </complexType>
</element>

<complexType name="bar">
  <sequnce>
    <element ref="foo"/>
  </sequnce>
</complexType>

<complexType name="baz">
  <sequnce>
    <element ref="foo"/>
  </sequnce>
</complexType>


Here both bar amd baz will have their own copy of anonymous type foo
generated inside each class unnecessarily duplicating the code (XSD
will warn you about this situation).


hth,
-boris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070601/c9d988cb/attachment.pgp


More information about the xsd-users mailing list