473,511 Members | 10,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question regarding generation of long class names

Hi all,

Hope no one minds this long message, but I'm puzzled:
---------------
The following is a shortened version of schema located at
http://www.ietf.org/internet-drafts/...h-iodef-10.txt

<xs:schema xmlns="urn:ietf:params:xml:ns:iodef-1.0"
xmlns:iodef="urn:ietf:params:xml:ns:iodef-1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:ietf:params:xml:ns:iodef-1.0"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="IODEF-Document">
<xs:complexType>
<xs:sequence>
<xs:element ref="iodef:Incident" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Incident">
<xs:complexType>
<xs:sequence>
<xs:element ref="iodef:IncidentID"/>
</xs:sequence>
<xs:attribute name="purpose" use="required">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="traceback"/>
<xs:enumeration value="mitigation"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="ext-purpose" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="IncidentID" type="iodef:IncidentIDType"/>
<xs:complexType name="IncidentIDType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="instance" type="xs:string" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>

I use xsd.exe to generate a C# class file, and the result is something like
so

class IODEFDocument
{
private Incident[] incidents;

[XmlElement("Incident")]
public Incident[] Incident{ get{ return incidents; } set{ incidents =
value; } }
}

class Incident
{
private IncidentIDType incidentIdType;
private IncidentPurpose purposeField;

public IncidentIDType IncidentID{ get{ return incidentIdType; } set{
incidentIdType = value; } }

[XmlAttribute()]
public IncidentPurpose{ get{ return purposeField; } set{ purposeField =
value; } }
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("xs d", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Anonymou sType=true)]
public enum IncidentPurpose {

/// <remarks/>
traceback,

/// <remarks/>
mitigation,
}

I created a web service to serve up an instance of IODEFDocument as defined
by the generated class file.

When I add a reference to this web service, the classes are defined in the
Reference.cs like this (roughly):

public class IODEFDocument
{
public IODEFDocumentIncident[] Incident{ get..; } set{ ...; } }
}

public class IODEFDocumentIncident
{
public IODEFDocumentIncidentPurpose purpose{ get{ ... } set{ ... } }
}

What I'm curious about is why the names of the classes and/or enumerations
keep getting extended.

For instance, this is one of the classes in Reference.cs when the full
schema definition for IODEFDocument is used:

public class IODEFDocumentIncidentEventDataFlowHostSystemNodeAd dress
{
}

Pretty much, you can tell the structure from that name:

class IODEFDocument
{
public Incident Incident;
}

class Incident
{
public EventData EventData;
}

class EventData
{
public Flow Flow;
}

class Flow
{
public Node Node;
}

and so, on down to class Address.

I consumed the service in JBuilder and got the same result for class names.

I'm just looking for an explanation why that happens, and if there is
anything that can be done about it. So that instead of working with an
IODEFDocumentIncidentEventData instance, I just work with EventData
instance.

In the schema for IODEF, just about everything is defined as elements, with
only a select few complexTypes if that makes any difference.

Thanks for any info,
Ron
Oct 25 '06 #1
0 1195

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2225
by: Melissa | last post by:
Hi, I'm new to the group and haven't had a chance to read the FAQ, but I have a question that's driving me crazy. If anyone here can help me with this or can point me to another site or...
6
1298
by: Kay | last post by:
Hello, My question isn't specific to .Net but as .Net is object oriented, I would be interested if someone could let me know if there is a standard way of implementing what I describe below in...
11
4707
by: Marco Loskamp | last post by:
Dear list, I'm trying to dynamically generate functions; it seems that what I really want is beyond C itself, but I'd like to be confirmed here. In the minimal example below, I'd like to...
6
2106
by: rodchar | last post by:
Hey all, I'm trying to understand Master/Detail concepts in VB.NET. If I do a data adapter fill for both customer and orders from Northwind where should that dataset live? What client is...
5
2123
by: Ale K. | last post by:
Hi, i'm designing my application that has a DLL that controls the Data Layer, and another that Controls the Bussines Layer, at some point my Bussines Layer need to Get an object ( Let's say a...
29
3537
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this...
7
2674
by: D. Patrick | last post by:
I need to duplicate the functionality of a java applet, and how it connects to a remote server. But, I don't have the protocol information or the java source code which was written years ago. ...
1
984
by: Evan Camilleri | last post by:
I am creating an DLL dynamically. Sometime or another this DLL must be recompiled and thus a new version must be uploaded. I was told that to do this I have to load the assembly in a seperate...
2
4831
by: developer.new | last post by:
Hi I have a question regarding this concept I learned about recently: Name Hiding. Here's what I've come across: There is a base class with two functions with the same name but different...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7427
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.