[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [regrep] [XML Schema issue] Replace choice with type substitution
Attached is the changes to rim.xsd if we went ahead with the proposed change. The lines starting with '-' are being removed. The line starting with '+' are being added. Other lines are shown for visual context. Notice how much cleaner the schema gets. Farrukh Najmi wrote: > > Team, > > In new V3 schema we have consistently used type substitution instead > of choice construct when defining XMl schema. Choice in the pinion of > many is not very object oriented and implementation experience has > shown that it complicates design. > > I would like to ask if any one has objections if we replace > occurrences of <choice> in the schema with type substitution. Here is > an example of how teh proposal effects the schema: > > Old Way > -------- > In query.xsd the definition of AdhocQueryRequest looks like: > > <sequence> > <element ref = "tns:ResponseOption" minOccurs="1" maxOccurs="1" /> > <choice minOccurs="1" maxOccurs="1"> > <element ref = "tns:FilterQuery"/> > <element ref = "tns:SQLQuery"/> > </choice> > </sequence> > > New Way > ------- > Above Old Way would look like this under the proposal: > > <sequence> > <element ref = "tns:ResponseOption" minOccurs="1" maxOccurs="1" /> > <element name="Query" type="tns:AdhocQueryType" minOccurs="1" > </sequence> > > Where AdhocQueryType is the base type for both SQLQueryType and > FilterQueryType. > > Benefits > --------- > Now code can be written using Object oriented principals so that there > is a AdhocQueryType class that is extended by SQLQueryType and > FilterQueryType classes. Either type of query may be abstractly > represented as a AdhocQueryType. > > Thanks for your input on this issue. > > > ---------------------------------------------------------------- > To subscribe or unsubscribe from this elist use the subscription > manager: <http://lists.oasis-open.org/ob/adm.pl> -- Regards, Farrukh
Index: rim.xsd =================================================================== RCS file: /cvsroot/ebxmlrr/ebxmlrr-spec/misc/schema/v3/rim.xsd,v retrieving revision 1.18 @@ -708,43 +708,11 @@ <element name = "ObjectRefList" type="tns:ObjectRefListType"/> - <complexType name = "LeafRegistryObjectListType"> - <choice minOccurs = "0" maxOccurs = "unbounded"> - <element ref = "tns:ObjectRef"/> - <element ref = "tns:Association"/> - <element ref = "tns:AuditableEvent"/> - <element ref = "tns:Classification"/> - <element ref = "tns:ClassificationNode"/> - <element ref = "tns:ClassificationScheme"/> - <element ref = "tns:ExternalIdentifier"/> - <element ref = "tns:ExternalLink"/> - <element ref = "tns:ExtrinsicObject"/> - <element ref = "tns:Organization"/> - <element ref = "tns:RegistryPackage"/> - <element ref = "tns:Service"/> - <element ref = "tns:ServiceBinding"/> - <element ref = "tns:SpecificationLink"/> - <element ref = "tns:User"/> - <element ref = "tns:Registry"/> - <element ref = "tns:Federation"/> - <element ref = "tns:Subscription"/> - - </choice> + <complexType name = "RegistryObjectListType"> + <sequence> + <element name="RegistryObject" type="tns:RegistryObjectType" minOccurs="1" maxOccurs="1"/> + </sequence> </complexType> - <element name = "LeafRegistryObjectList" type = "tns:LeafRegistryObjectListType"/> - - <complexType name = "RegistryObjectListType"> - <complexContent> - <extension base = "tns:LeafRegistryObjectListType"> - - <choice minOccurs = "0" maxOccurs = "unbounded"> - <element ref = "tns:RegistryEntry" /> - <element ref = "tns:RegistryObject"/> - </choice> - </extension> - </complexContent> - </complexType> - <element name = "RegistryObjectList" type = "tns:RegistryObjectListType"/> - + <element name = "RegistryObjectList" type = "tns:RegistryObjectListType"/> </schema>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]