Team LiB
Previous Section Next Section

What Is XML to .NET?

Normally, XML is covered along with Web services and Internet programming technologies such as ASP.NET. You will find many large and imposing books that discuss XML to death, along with how to use it in the Internet space. What I am concerned with here is how XML is used in the Windows Forms "space," if you will.

Traditionally, a Windows application uses the following types of files for storage:

You normally don't think of using XML files for a desktop application. However, this is gaining more favor among developers and it's a big part of .NET. The .NET Framework uses XML files extensively for configuration files. You saw this in Chapter 7 when you turned tracing on and off using an XML configuration file.

XML files are used as a transport medium in .NET to allow interprocess communication through simple firewalls. XML is text-based and, as such, is let through port 80 on a server. This is changing, though, as XML firewalls are becoming more the norm these days.

XML is also used by .NET as a transport medium for client/server programs even if they reside on the same machine. Coverage of Remoting is beyond the scope of this book, but I will give you this tidbit: Remoting can change from a fast binary protocol to a slower XML-based SOAP protocol with a single line change in a configuration file. There is no need to write two transport stacks—.NET does it all for you.

In this chapter I cover how to read, write, and use XML files, and how to validate them. I do not go into any great depth with XML. Entire books are devoted to that subject.


Team LiB
Previous Section Next Section