B. Solution Architecture

  1. Version 2.0 of the .NET Framework supports parameterizing classes by a mechanism called generics. This mechanism looks and feels very much like the template mechanism in C++ or Java. The designer of a class, such as System.Collections.Generic.List, specifies that the class can accept a type as a parameter by using a special syntax, as shown on the facing page. Note that IntelliSense has properly detected the type that the generic list holds (in this case, string) and displays it, thus being more specific and therefore more useful.

    The client programmer is passing the String type, saying, "Here, create me a list that holds only strings, please." Any attempt to store an object other than a string in that list causes a compiler ...

Get Programming Microsoft® Composite UI Application Block and Smart Client Software Factory now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.