0

I'm on a project where the lead person says we need to create our simple C# classes with XSD files. From what I can tell the C# classes will be used just like a DTO (Data Transfer Objects). So they are very simple with just property names. in a few cases a class might reference another as an array. This is a simple task in Visual Studio just creating with the class library template. But seems like a lot of work to make an XSD file to create the classes instead. Here is an example of a c# class being created with an XSD File:

public Class Product
{
 string ProductName {get;set}
 int InventoryCode {get;set;}
 string Manufacturer {get;set;}
}

These classes are being created for a .asmx web service project. The client applications are other c# asp.net applications.

When do you need to make classes using XSD instead of the Visual Studio class library template approach?

Robertcode
  • 911
  • 1
  • 13
  • 26
  • Reasons to use XSD are well documented, see for example the [duplicate](http://stackoverflow.com/questions/3403644/what-is-the-purpose-of-xsd-files). In short: it defines an interface or template to which documents must conform, and you can use it to generate classes in other languages, in which clients for this service can be written. Though you'd rather use WSDL to generate clients and contracts. Keyword there being "contract first service development". Also, don't use the deprecated ASMX technology for new development, use WCF or WebAPI. – CodeCaster Oct 04 '16 at 21:23
  • Create an application generator and generate out the XSD / C# POCO classes. Honestly, little classes like that are wasteful IMHO. – William Walseth Oct 04 '16 at 21:26

0 Answers0