I’m working hard to stave off the entropy of my consciousness. One approach is to learn something that creates order in the mind. I’m starting with the .NET Framework (pronounced dot net) Class Library. The .NET Framework Class Library is essentially a library of software for building software. It consists of a hierarchy of namespaces, which lends itself well to creating order. Actually, I don’t think the namespaces are truly hierarchical. They just appear to be. It’s not the actual namespaces that are hierarchical, rather it’s the data types that are organized by the namespaces. The inheritance pattern of the data types creates the relationships between namespaces.
The System namespace is often considered the top namespace. In a sense it is the top because all data types inherit from the System.Object data type. In other words, all the data types in the .NET Framework are children of System.Object. For example, the string data type (System.String) inherits from System.Object. So the hierarchy looks like this:
Everything to the left of the last period is the namespace. The word at the end is the data type. Consider the data type Font. The fully qualified name is System.Drawing.Font. The namespace is System.Drawing. The inheritance hierarchy looks like this:
Notice that there’s a type in between System.Object and System.Drawing.Font. It’s easy to think that System.Drawing is a sub-namespace of System, until you see something like this. Here’s another good example:
A Web part (in ASP.NET) is a kind of Panel, which makes sense when you think about. Panels are things you can turn on and off and use as containers for other controls. Web parts in SharePoint are a kind of ASP.NET Web part. That last data type – Microsoft.SharePoint.WebPartPages.WebPart – isn’t part of the .NET Class Library. It’s part of a Microsoft server application called SharePoint. And there are specialized kinds of Web parts in SharePoint that inherit from WebPart.
As you can see, it’s very complex but also very simple. It all starts at System.Object.