You are on page 1of 5

Supporting you, supporting me, AND Arcky-Snarky: you must critically compare

and discuss the .NET framework architecture (AC42.1.2). In this article you should
consider elements such as the CLI, memory management, and class libraries, etc. You
should also discuss the evolution of the .NET framework and compare framework
versions (e.g. 3.5, 3.0, 2.0)

SINCE THESE ARTCLES OVERLAP WE HAVE INCLUDED THEM IN ONE LARGER ARTICLE

The .Net framework version 1.0 was initially released in 2002 with the purpose of being a virtual
machine for running code for various .Net compatible languages e.g. C#, and it is currently at version
4.7.2 so it has a significant version history with each successive iteration being stacked upon the last.
The idea of the .Net framework is to run be able to build and run the next generation of applications
and XML web services whilst minimising unfavourable occurrences such as software deployment
conflicts, versioning conflicts, not using industry standards for communication and thus hindering
the ability to integrate with other code and avoiding unsafe code execution e.g. that from untrusted
third-parties. Also, importantly the vision across all successive iterations is to ensure that the
developer experience remains consistent across all types of applications which will be a very
attractive prospect to them i.e. less workload and confusion. It must be noted that the .Net
framework was designed for backwards compatibility i.e. any app that we develop for a platform
version (i.e. in the older versions 1.0, 2.0, 3.0 and 3.5) is able to run on later versions of that platform
(i.e. the more recent versions 4.0 and above) (Docs.Microsoft.com. 2018) and so we can say that
each version is additive. However, this is not as straightforward as it sounds as backwards
compatibility can be hindered by two factors: firstly, seemingly inconsequential changes made to the
framework i.e. bug fixes, performance enhancing measures, and security considerations, and
secondly by any significant changes in programming techniques. When we run an application
originally intended for an older version (we say that the application is “Targeted” for a given version)
the .Net framework uses what is called “Quirked” behaviour to act as if the application is running on
that older version even though it is not (i.e. it’s running on the newer version), and this will serve to
solve most computability issues. If a developer experiences any problems with backwards
compatibility they can use the .Net framework 4 RTM application compatibility walkthrough
(Majidimehr, 2010) to test their applications and find an appropriate solution. Failing this the .Net
framework 4.5 can run side-by-side (side-by-side execution) with older versions, so we can simply
install an older version of the .Net framework to run our application alongside the newer version
running everything else. The next version of the .Net framework was released in 2005 and is the
version 2.0 stack which has quite a basic architecture with the CLR (Common Language Runtime) at
the bottom level (this sits on top of the OS however and is basically a system application that is run
on the Windows OS). To make matters more complicated the two main components of the .Net
framework are separately versioned i.e. firstly there is a set of assemblies (various types and
resources) that supply the various applications with their required functionalities (it must be noted
that these assemblies and the .Net framework will possess the exact same version number).
Secondly there is the CLR (Common Language Runtime) that is responsible for two major tasks:
managing the application’s code (thus the code is referred to as managed code) and executing such
code that has been written in any of the compatible .Net languages, and this in contrast is assigned
its own version number (Docs.Microsoft.com. 2019). The CLR internally implements the VES (Virtual
Execution System) and is a structure layer that is probably the most important part of the .Net
framework: it is equivalent to the JVM (Java Virtual Machine) in the Java programming language,
with its main functions apart from application execution being memory management (garbage
collection), thread management, exception handling, looking after security etc. All code that is
handled by the CLR is called managed code and this makes development much easier thanks to the
various services on offer, and hence any code that falls outside of its reach is unmanaged code. Each
language will be written by the developer in the relevant source code and since each compatible
language has its own compiler, it is the job of a given compiler to convert this source code into the
MSIL (Microsoft Intermediate Language) which is basically code that is machine independent, not
forgetting the associated metadata e.g. the implementations of all the functions in that code, the
class libraries used, environment version etc. This is then passed to the CLR with its internal JIT (Just
In Time) compiler which then takes the MSIL code and aggregates into a local executable file which
can then be executed by the CPU of the target machine when required (.exe or .dll formats). In fact,
there are four major components of the CLR: the CLS (Common Language Specification), the CTS
(Common Type System), the GC (Garbage Collector), and the JIT compiler as previously discussed.
The CTS concerns itself with standardising the data types can be used within the managed code at
the runtime i.e. their declaration, management, and usage. The functionality provided by the CTS
allows for highly effective communication between the various languages i.e. language
independence, since every data type from each language becomes a common data type (value types
and reference types) through this conversion process. On the other hand, the CLS is a subset of the
CTS and this facilitates cross-language integration and interoperability (C-sharpcorner.com. 2019) in
that it makes languages CLS compliant through imposing a set of rules and restrictions upon them to
ensure that there are common accepted standards for the .Net framework (although it is certainly
possible to also use non-CLS complaint code e.g. by using unsigned types). The GC facility of the CLR
is responsible for automatic memory management so that any code objects that are created (put
into generation 0) that are no longer being used i.e. dead objects in the generation with no
references are quickly freed from memory (i.e. deallocation) to increase overall application
performance. All surviving living objects will then enjoy promotion to the next level with the top
level being generation 3 (this is for stable objects).

The FCL (Framework Class Library) sits on top of the CLR and this is basically a large collection of class
libraries (thousands of examples available to developers of shared code for them to use in their
projects). Sitting on top of the FCL are the types of applications that it is possible to build upon the
.Net framework, with versions 1.0 and 2.0 stack having three distinct types: firstly, WinForms which
are form-based GUI applications (runs on a computer with a variety of controls such as textboxes
and submit buttons e.g. a login form for another application, and will not run in a web browser since
then it would become a web application). There is a designer in Visual Studio to drag-and-drop
allowing for simple UI WinForms construction without the developer having to do any coding.
Secondly, there is ASP.net applications (Active Server Pages) which are primarily for web
applications, websites, and various web services (web services were assigned to ASP.net in the
release of the .Net framework 2.0 stack) (GeeksforGeeks. 2018). In fact, it must be noted that the
ASP.net code cannot be viewed from inside of the user’s browser since it is executed on the server
(all a user will see is a standard HTML output). The usual file extension for a ASP.net application is
the .aspx format, and if we have a webpage with such an extension then Visual Studio will also
create another page with the .aspx.cs extension which is the location of the code page (so one page
for the actual design and another for the code) (Guru99.com. 2019). Thirdly, there is ADO.net
(ActiveX Data Objects) which are distributed and data-sharing applications that are highly scalable
and interoperable (Docs.Micorsoft.com. 2017) and are designed to connect application systems with
database servers. It is evident that ADO.Net consists of a collection of classes (single object-oriented
set of classes to be exact) that is compiled purely for the intention of being able to effectively handle
data access and perform CRUD (Create Read Update Delete) operations upon databases, and the
transfer of data is facilitated by using XML to cache and transfer it which invariably proves to be a
boon for developers of both desktop and distributed applications alike since they now have an
industry standard and high performance i.e. fast way for these types of applications to access the
data that they require. So, we can see that ADO.net can map data stored in a multitude of ways
including MySQL Server Database or perhaps any format provided that can be accessed by using the
ODBC (Open Database Connectivity) API (Penland, J. 2018), and it must be noted that this holds true
for all the compatible programming languages. However, it is evident that there are two major types
of data access architecture that ADO.Net supports: firstly, connected data access architecture where
there is a continual connection maintained to the data source with SQL commands executed upon
that data, and the connection remains open even in the absence of any commands being issued (The
DataReader class holds the data on the client). The immediate benefit of this is that data
concurrency is maintained since only one user at a time can update the information within a
database and all refreshed data is available in real-time. The major drawback of this is that there can
be network congestion especially with the larger transactions as there will be a lot more commands
to deal with. Secondly, we have disconnected data access architecture which only opens the
connection to allow for data retrieval and then this is immediately closed so there are no network
issues with this model (thanks to the storage within the DataSet object on the client), and this data
can be manipulated and then consequently reconciled with the source when required. Thus, we can
see that a total of three types of applications can be built upon the .Net 1.0 and 2.0 frameworks, and
successive iterations have served to further extend this functionality. If we want to discover which
version(s) of the .Net framework we have installed we are able to achieve this by accessing the
registry. We have included a diagram to illustrate .Net framework version history which shows the
various types of applications can be run over the most basic architecture that we have been
describing (2.0) i.e. these are stacked on top of each successive iteration. For example, we can see
that in version 3.0 (the next stack) we are able to run four new types of applications: firstly, WPF
(Windows Presentation Foundation) which is the successor to WinForms and is a UI (User Interface)
framework that is primarily used to build line-of-business desktop applications. Secondly we have
WCF (Windows Communication Foundation) applications and this is the successor to Indigo. It is
used for sending data as asynchronous messages (Docs.Microsoft.com. 2017) between service
endpoints (i.e. simple characters and words in XML or alternatively as binary data streams) for a
variety of purposes such as real-time chat services or the secure processing of business transactions.
Thirdly, we have WF (Windows Workflow Foundation) that facilitates the building of workflows
within .Net applications. Fourthly, there is Card Space which is the newest version of Infocard and
serves as an identity metasystem whereby we can create digital identities for users (so they can be
electronically represented) in terms of different information cards, and then this service UI will
popup when they need to authenticate they identity on various websites and applications for secure
access. We must never uninstall any versions of the .Net framework when installing a new version
since it is common practice to run multiple versions simultaneously (side-by-side execution) and
doing so may break an application that is relying upon an older version (although it must be noted
that we can’t run 2.0, 3.0, and 3.5 side-by-side). From the diagram we can see that version 4.5 is an
in-place update that replaces 4.0, and the most recent version 4.7.2 is also an in-place update over
all versions from 4.5 up to 4.7.1 which entails that although the runtime version remains identical
we can see that the assembly version is indeed updated in terms of offering new types and
members. There are two major issues fixed with this update i.e. SQL Server issues (NRE – Null
Reference Errors occurring in Azure SQL DB) and WPF (Windows Presentation Framework) issues
(unexpected crashing in applications), together with many other improvements such as enhanced
TLS support and Elliptic Curve Cryptography for superior levels of security.
COMPONENT _ CLS COMMON LANGAUGE SPECIFICATION still to do (put
near CLR

References

Docs.microsoft.com. (2019). How to: Determine which .NET Framework versions are
installed. [online] Available at: https://docs.microsoft.com/en-
us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
[Accessed 28 Mar. 2019].

GeeksforGeeks. (2018). C# | .NET Framework (Basic Architecture and Component Stack) -


GeeksforGeeks. [online] Available at: https://www.geeksforgeeks.org/c-sharp-net-
framework-basic-architecture-component-stack/ [Accessed 28 Mar. 2019].

Guru99.com. (2019). What is ASP.NET? and its ARCHITECTURE. [online] Available at:
https://www.guru99.com/what-is-asp-dot-net.html [Accessed 28 Mar. 2019].

Docs.microsoft.com. (2017). ADO.NET. [online] Available at: https://docs.microsoft.com/en-


us/dotnet/framework/data/adonet/ [Accessed 28 Mar. 2019].
Penland, J. (2018). Learn ADO.Net: How to Build Databases and More. [online] Available
at: https://www.whoishostingthis.com/resources/ado-net/ [Accessed 28 Mar. 2019].

Docs.microsoft.com. (2017). What Is Windows Communication Foundation? [online]


Available at: https://docs.microsoft.com/en-us/dotnet/framework/wcf/whats-wcf
[Accessed 30 Mar. 2019].

Docs.microsoft.com. (2018). Version Compatibility in the .NET Framework. [online]


Available at: https://docs.microsoft.com/en-us/dotnet/framework/migration-
guide/version-compatibility [Accessed 30 Mar. 2019].

Majidimehr, R. (2010). .NET Framework 4 RTM Application Compatibility Walkthrough.


[online] Docs.microsoft.com. Available at: https://docs.microsoft.com/en-us/previous-
versions/dd889541(v=msdn.10) [Accessed 30 Mar. 2019].

You might also like