Library Organizational Structure


The first thing you need to know about the .NET Framework class library is that it is an object-oriented tree derived from a single root: System::Object. The next important characteristic is that the .NET Framework class library strictly follows the rules specified by the Common Language Specification (CLS), as covered in Chapter 1. The key rules that you should be aware of are as follows:

  • Global methods and variables are not allowed.

  • There is no imposed case sensitivity, so all exposed types differ by more than their case.

  • The only primitive types allowed are Byte, Int16, Int32, Int64, Single, Double, Boolean, Char, Decimal, IntPtr, and String.

  • Variable length argument lists are not allowed. Fixed-length arrays are used instead.

  • Pointers are not allowed.

  • Class types must inherit from a CLS-compliant class.

  • Only single class inheritance is allowed, though multiple inheritance of interfaces is permitted.

The final and most important aspect of the .NET Framework class library is that the current version is broken up into nearly 100 namespaces. Unlike many other libraries, the component identifiers used for the namespaces are self-describing, and thus have the benefit of making it easy to understand what functionality resides within a namespace.

You should be aware that even though namespaces in the .NET Framework class library appear to be broken up into a hierarchy, there is, in fact, no actual "class inheritance hierarchy" that corresponds directly to this "namespace hierarchy." Instead, the namespaces are simply a way of organizing classes into common functionality groups. For example, there is a "namespace hierarchy" of System::Collections::Specialized, but many of the classes found in the System::Collections::Specialized namespace don't inherit from System::Collections.

The .NET Framework class library is physically made up of multiple assembly .dlls. An assembly does not necessarily correspond directly to a namespace, as some of the namespaces spread across multiple assemblies. Also, an assembly may contain multiple namespaces. This does complicate things, but the .NET Framework class library has placed the most commonly used classes into one assembly: mscorlib.dll. Then, it spread out the less common classes into assemblies made up of common functionality.

Unfortunately, I know of no way of easily figuring out which assembly contains which classes. I've tried to help you in this regard by pointing out the necessary assemblies to include for each namespace. The only other way I know of to figure out which assembly is needed is to look for the C1190 error when compiling (I guess "linking" is more accurate). This error tells you which assembly is missing.




Managed C++ and. NET Development
Managed C++ and .NET Development: Visual Studio .NET 2003 Edition
ISBN: 1590590333
EAN: 2147483647
Year: 2005
Pages: 169

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net