Simon Fell > Its just code > Type Hierarchies

Tuesday, October 21, 2003

More and more services seem to be using derived complex types (like below) to get type hierarchies in their language of choice, works great for those languages that it maps cleanly to (like c# and java), but its painful but possible in VB6. Ran into one VB6 bug (no chance of seeing a fix for it) where interface methods can't have _ in the name, the compiler fails to see the implementation in the implementing class. As far as I can see from the docs _ is valid in a method name, oh well, one more wrinkle in the xsd -> vb name mapping process.

	<complexType name="Entity">
		<sequence>
			<element name="Id" type="xs:string"/>
			<element name="LastModified" type="xs:dateTime"/>
			<element name="LastModifiedBy" type="xs:string"/>
		</sequence>
	</complexType>
	<complexType name="Contact">
		<complexContent>
			<extension base="tns:Entity">
				<sequence>
					<element name="ContactPerson" type="xs:string"/>
					<element name="ContactPhone"  type="xs:string"/>
				</sequence>
			</extension>
		</complexContent>
	</complexType>
	<complexType name="Customer">
		<complexContent>
			<extension base="tns:Contact">
				<sequence>
					<element name="Since" type="dateTime"/>
				</sequence>
			</extension>
		</complexContent>
	</complexType>