.NET Complete

The .NET Framework

I spoke about some of this in the preview talk a while back, but let me rehash it and go into a bit more detail.

To be clear: Microsoft is not anally protective of their .NET source code. Almost everything they do is publicly shared via the ECMA (ecma-international.org.) In fact, you can freely download the C# specifications (not bad actually) and the entire CLI (Microsoft's CLR -- the brain behind .NET) specifications including details that you would think you would need to buy a book to read about. So, they are not ultra protective of their designs or really any .NET technologies. They and only they make them, but they share almost all their work. They hand the .NET framework source code out for the world to see and learn from and to extend.

The .NET framework is the framework that all other .NET applications (yours and theirs) are built upon. In your own infrastructure you create you own framework (what some of you call the "code base") that your own applications will be built upon. Further specializations of applications built upon your own frameworks built upon your own frameworks. This is the entire concept and design philosophy of .NET architecture.

The entire .NET framework was written in C# and, as I say, the source code is freely available. That said, when you compile .NET code (C#, VB.NET, J#, etc...) you are compiling to to CIL (Common Intermediate Language) or what I call ".NET Assembly Language" (since you use it to create .NET assemblies and it looks like machine-based assembly language.) *This* is what is freely available. You can view THIS code in any language you want. It's not really decompiling, it never was 100% compiled. You are merely "reflecting" upon it. Reflection is an advanced .NET concept we may cover down the road. (as a side note, even though .NET code is not compiled by a compiler at compile time, it is compiled to the machine's native code (just like C++ would) when the application is first ran making all further use very fast.)

To view the .NET source code you need an application that reflects the data so you can see it. The most popular (ok, well the ONLY one that really does it well!) is called Reflector. It's small enough to just zip to everyone. It's one file and I highly recommend you keep it in a very easy to access place (i.e. make an icon!) You will also want to download and install the .NET framework (1.1 or you can get 2.0 from me) if you have not done so already.

When you look through the .NET framework source code (which is beautifully structured and easy to navigate in Reflector) notice how things are highly cohesive, even though they may have 30-40 methods. Also notice how the inheritance flows. You will also notice very small classes that don't seem to "do" much. Again, I remind you that the focus of OO is not "doing", but rather "building." Most of these smaller classes are beautify implemented design patterns. You can also dig down into various parts to see how things are really accessing external systems. For example, if you dig through the System.Data.SqlClient namespace you will see how the RPC calls are made directly to SQL Server. It's also very easy to read...

The goal is to make your own frameworks and applications as fluid as the .NET framework because even the .NET framework is something built on something else. Within the .NET framework there is a section called the BCL (the Base Class Library). This class library is that core functionality (also written in C#) that the rest of .NET is built upon. Thus, your own applications should follow a similar design: core components are universal and other parts are built on top of those. This is easily seen in how WinFX is built upon the existing .NET framework. The .NET framework is built upon the BCL (which IS the .NET framework, really) and Avalon (Windows Presentation Framework) and Indigo (Windows Communication Framework) are built on top of THAT. In WinFX, applications working in presentation (fonts, colors, documents, images, etc...) are built on top of Avalon and applciations (the same application probably!) working in communication (Web Services, Remoting, just about any other servicing and connectivity!) are built on top of Indigo. Basically, you just build whatever you are building upon that which is already rebuilt. Think in terms of "building", not in terms of "doing"...

_This_ is the beauty of fluid of development and reuse that comes from building applications using .NET...