Redundant code is generated

Feb 8, 2011 at 12:24 PM

When an element is used in two different places in a schema, the tool generates a class to represent each instance. These two classes are different in name only and could be better represented by a single class. A developer using the generated code must then also create code that is essentially redundant.

Eg. A schema contains an Info element and uses it to represent the information (including an address) for a Buyer and a Seller. The tool generates two different "Info" classes that are different in name only. This cascades into all classes contained within it. So we have BuyerInfo, SellerInfo, BuyerInfoAddress, SellerInfoAddress, BuyerInfoName, SellerInfoName, etc.

This is especially burdensome in schemas that take advantage of reuse to reduce complexity, such as schemas in the NIEM. Xsd2Code is very useful, but this issue causes me to have to write a lot of redundant code.

Coordinator
Feb 8, 2011 at 8:50 PM

Thank you for your feedback.

Can you post here a sample (schema). With your sample i'am going to find a solution.

Thank you.

Pascal.

Feb 9, 2011 at 4:00 PM

Pascal-

Thanks for your response. While preparing my reply I determined that the reason for the redundancy was in the schema, not the tool.

I withdraw my feedback.

Thank you
-Glenn



----- Original Message -----
From: "pcabanel" <notifications@codeplex.com>
To: [email removed]
Sent: Tuesday, February 8, 2011 4:50:19 PM
Subject: Re: Redundant code is generated [Xsd2Code:245108]

From: pcabanel

Thank you for your feedback.

Can you post here a sample (schema). With your sample i'am going to find a solution.

Thank you.

Pascal.