c# generics 3.0

I was just reading MattWar's web log (The Wayward Weblog) about in C#3.0. The article mentions that furure generics might be also tied to XML Types.

I am not too sure I understand the concept. Well not at least the way it was described. To Quote:

"On the surface, the two might seem to have nothing to do with each other, but if you dig deeper you soon realize that the two are fundamentally linked, the two concepts not separate but actually compliments of oneanother."

The log goes futher, it describes how they are conceptually linked together. However, from what I have read, it is only the fact that a generic and an XML enclosure is syntatically similar by the use of angled brackets.

Currently as I understand it generics, allow the use of parameterised specialisation of a class without having to re-write the class to handle different types of objects. For instance a list collection can be "bound" to an int, long, Cars, EarMuffs etc, and the type checking of the compiler will ensure that all uses are syntacitcally and sematically correct.

The example of an is Foo<int x ="..."/>, unfortuatly I don't really understand what is happenging there.

I just simply don't understand the point of (using the blogs example). Why not generate your class from an XSD and paramaterise the type to the XSD'ed class.

Will future XML Generics be tied to a schema, so that parameters can be constrained via certain values (which I can see the point of, Foo<int type="xsd:positiveInteger" restriction="minValue"/> which would might constrain the Foo object to types on integers with a minValue) .

I am really looking forward to futher information on this. Because I am sure it is correct that it is a shift and a major question to re-work my current understanding.

I lead the Chrome Developer Relations team at Google.

We want people to have the best experience possible on the web without having to install a native app or produce content in a walled garden.

Our team tries to make it easier for developers to build on the web by supporting every Chrome release, creating great content to support developers on web.dev, contributing to MDN, helping to improve browser compatibility, and some of the best developer tools like Lighthouse, Workbox, Squoosh to name just a few.

I love to learn about what you are building, and how I can help with Chrome or Web development in general, so if you want to chat with me directly, please feel free to book a consultation.

I'm trialing a newsletter, you can subscribe below (thank you!)