Dot NET Framework (Architecture).

Common Language Infrastructure (CLI).

The purpose of CLI is to provide a language-neutral platform for application development and execution, including functions for exception handlinggarbage collection, security, and inter operatibility. By implementing the core aspects of .NET Framework within the scope of CLI, this functionality will not be tied to a single language but will be available across the many languages supported by the framework. Microsoft's implementation of CLI is CLR. Common Intermediate Language (CIL) code is housed in CLI assemblies. As mandated by the specification, assemblies are stored in Portable Executable (PE) format, common on Windows platform for all DLL and EXE files. The assembly consists of one or more files, one of which must contain the manifest, which has the metadata for the assembly. The complete name of an assembly (not to be confused with the file name on disk) contains its simple text name, version number, culture, and public key token. Assemblies are considered equivalent if they share the same complete name, excluding the revision of the version number. A private key can also be used by the creator of the assembly for strong naming. The public key token identifies which private key an assembly is signed with. Only the creator of the key pair (typically .NET developer signing the assembly) can sign assemblies that have the same strong name as a previous version assembly, since the creator is in possession of the private key. Strong naming is required to add assemblies to Global Assembly Cache

Security.

.NET has its own security mechanism with two general features: Code Access Security (CAS), and validation and verification. CAS is based on evidence that is associated with a specific assembly. Typically the evidence is the source of the assembly (whether it is installed on the local machine or has been downloaded from the intranet or Internet). CAS uses evidence to determine the permissions granted to the code. Other code can demand that calling code be granted a specified permission. The demand causes CLR to perform a call stack walk: every assembly of each method in the call stack is checked for the required permission; if any assembly is not granted the permission a security exception is thrown.

Class library.

.NET Framework includes a set of standard class libraries. The class library is organized in a hierarchy of name spaces. Most of the built-in APIs are part of either System.*  or Microsoft.* name spaces. These class libraries implement a large number of common functions, such as file reading and writing, graphic rendering, database interaction, and XML document manipulation, among others. .NET class libraries are available to all CLI compliant languages. .NET Framework class library is divided into two parts: FCL and Base Class Library (BCL).
FCL includes a small subset of the entire class library and is the core set of classes that serve as the basic API of CLR. Classes in mscorlib.dll and some classes inSystem.dll and System.core.dll are part of FCL. FCL classes are available in .NET Framework as well as its alternative implementations including .NET Compact FrameworkMicrosoft Silverlight and Mono.
BCL is a superset of FCL and refers to the entire class library that ships with .NET Framework. It includes an expanded set of libraries, including Windows Forms, ADO.NET,ASP.NET, Language Integrated Query, Windows Presentation Foundation, Windows Communication Foundation among others. BCL is much larger in scope than standard libraries for languages like C++, and comparable in scope to standard libraries of Java. 

Memory management.

CLR frees the developer from the burden of managing memory (allocating and freeing up when done); it handles memory management itself by detecting when memory can be safely freed. Instantiations of .NET types (objects) are allocated from the managed heap; a pool of memory managed by CLR. As long as there exists a reference to an object, which might be either a direct reference to an object or via a graph of objects, the object is considered to be in use. When there is no reference to an object, and it cannot be reached or used, it becomes garbage, eligible for collection. .NET Framework includes a garbage collector which runs periodically, on a separate thread from the application's thread, that enumerates all the unusable objects and reclaims the memory allocated to them., .NET Garbage Collector (GC) is a non-deterministic, compacting, mark-and-sweep garbage collector. GC runs only when a certain amount of memory has been used or there is enough pressure for memory on the system. Since it is not guaranteed when the conditions to reclaim memory are reached, GC runs are non-deterministic. Each .NET application has a set of roots, which are pointers to objects on the managed heap (managed objects). These include references to static objects and objects defined as local variables or method parameters currently in scope, as well as objects referred to by CPU registers. When GC runs, it pauses the application, and for each object referred to in the root, it recursively enumerates all the objects reachable from the root objects and marks them as reachable. It uses CLI metadata and reflection to discover the objects encapsulated by an object, and then recursively walk them. It then enumerates all the objects on the heap (which were initially allocated contiguously) using reflection. All objects not marked as reachable are garbage. This is the mark phase.Since the memory held by garbage is not of any consequence, it is considered free space. However, this leaves chunks of free space between objects which were initially contiguous. The objects are then compacted together to make used memory contiguous again. Any reference to an object invalidated by moving the object is updated by GC to reflect the new location. The application is resumed after the garbage collection is over. GC used by .NET Framework is also generational. Objects are assigned a generation; newly created objects belong to Generation 0. The objects that survive a garbage collection are tagged as Generation 1, and the Generation 1 objects that survive another collection are Generation 2 objects. .NET Framework uses up to Generation 2 objects. Higher generation objects are garbage collected less frequently than lower generation objects. This helps increase the efficiency of garbage collection, as older objects tend to have a longer lifetime than newer objects. Thus, by eliminating older (and thus more likely to survive a collection) objects from the scope of a collection run, fewer objects need to be checked and compacted.

Standardization and licensing.

In August 2000, Microsoft, Hewlett-Packard, and Intel worked to standardize CLI and C#. By December 2001, both were ratified ECMA standards. ISO followed in April 2003. The current version of ISO standards are ISO/IEC 23271:2012 and ISO/IEC 23270:2006.
While Microsoft and their partners hold patents for CLI and C#, ECMA and ISO require that all patents essential to implementation be made available under "reasonable and non-discriminatory terms". In addition to meeting these terms, the companies have agreed to make the patents available royalty-free. However, this did not apply for the part of .NET Framework not covered by ECMA/ISO standards, which included Windows Forms, ADO.NET, and ASP.NET. Patents that Microsoft holds in these areas may have deterred non-Microsoft implementations of the full framework.
On 3 October 2007, Microsoft announced that much of the source code for .NET Framework Framework Class Library (including ASP.NET, ADO.NET, and Windows Presentation Foundation) was to have been made available with the final release of Visual Studio 2008 towards the end of 2007 under the shared source Microsoft Reference License. The source code for other libraries including Windows Communication Foundation (WCF), Windows Workflow Foundation (WF), and Language Integrated Query (LINQ) were to be added in future releases. Being released under the shared-source Microsoft Reference License means this source code was made available for debugging purpose only, primarily to support integrated debugging of FCL in Visual Studio. On 12 November 2014, Microsoft announced it would open source .NET Core. The effort will include cross-platform support for .NET, the source release of Microsoft's Core CLR implementation, source for the "entire [...] library stack" for .NET Core, and the adoption of a conventional ("bazaar"-like) open source development model under the stewardship of the .NET Foundation. Miguel de Icaza describes .NET Core as a "redesigned version of .NET that is based on the simplified version of the class libraries", and Microsoft's Immo Landwerth explained that .NET Core would be "the foundation of all future .NET platforms".
At the time of the announcement, the initial release of the .NET Core project had been seeded with a subset of the libraries' source code and coincided with the re-licensing of Microsoft's existing .NET reference source away from the restrictions of the Microsoft Reference License. Both projects are made available under the MIT License. Land werth explained that one of the disadvantages of the previously selected shared source license was that it "made Rotor [the Microsoft reference implementation] a non-starter" as a community-developed open source project because it did not meet the criteria of an OSI-approved license. Microsoft also produced an update to its patent grants, which further extends the scope beyond its previous pledges. Whereas before projects like Mono existed in a legal grey area because Microsoft's earlier grants applied only to the technology in "covered specifications", including strictly the 4th editions each of ECMA-334 and ECMA-335, the new patent promise places no ceiling on the specification version and even extends to any .NET run time technologies documented on MSDN that haven't been formally specified by the ECMA group, if a project chooses to implement them. This permits Mono and other projects to maintain feature parity with modern .NET features that have been introduced since the 4th edition was published without being at risk of patent litigation over the implementation of those features. The new grant does maintain the restriction that any implementation must maintain minimum compliance with the mandatory parts of the CLI specification.
Microsoft's press release highlights that the cross-platform commitment would now allow for a fully open source server-side .NET stack. However, Microsoft does not plan to release the source for Windows Presentation Foundation or Windows Forms.


SHARE THIS

Author:

Previous Post
Next Post