History of .Net Framwork Architecture

  • The Development of .Net Framework Architecture was started in 1998 by Microsoft Inc.
  • Finally, in December, the first commercially stable forms came on the market in Feb 2002.

Introdcution of .Net Framwork Architecture

  • Microsoft has combined various modern as well as existing technologies of software development in .NET Framework.
  • It is believed that there are about 3-4 million/more Java programmers present today but about 3 million Visual C++ developers, 3-8 million VB developers and around 1 million C# developers available in the world. Thus, we can say that today, most development and deployment occurs in Windows.

Definition of .Net Framwork Architecture

  • The .NET Framework Architecture in VB .Net is a new, complete, software programming environment/platform/technology that allows developers to develop, run, and deploy different types of applications in one environment.

Features of .Net Framwork Architecture

.Net Framework Architecture –

  • Built for the web.
  • Sits on top of the OS.
  • Gives unified API and multi-language support.
  • Runs primarily on Microsoft Windows OS but may run in all OS.
  • Has strong emphasis on Web connectivity, using XML web services to connect and share data between smart client devices, servers, and developers/users along with several latest technologies.
  • These technologies are used by developers to develop highly efficient applications for modern as well as future business needs.

.Net Frame Architecture

.Net Framework Architecture : Coders HelplineThere are following core components of the .NET Framework level wise are: –

  • Multiple Programming Languages:
    • .Net Framework supports multiple Microsoft languages such as VB .Net, C#, Visual C++, F#, JavaScript, etc., and other languages such as COBOL, Eiffel, Fortran, Mercury, Pascal, Python, Ruby, SML, Perl, Smalltalk, etc.
  • Common Language Specification(CLS) :
    • CLS is a set of rules that specifies features that all languages should support.
    • CLS is an agreement among language designers and class library designers about the features and usage conventions that can be relied upon. 
  • Framework Class Library :
    • The class library and the CLR together constitute the major part of the .NET Framework.
    • Includes a large no. of libraries(above 9000 libraries) hence rich in in-built methods which may be used in programming environments.
    • The Class library contains the Base classes related to networking, security, I/O files, Windows UI, Data and XML Classes, Web Services/UI etc.
    • This .NET library is available to all .Net supporting programming languages.
  • Common Language Runtime(CLR) :
    • The CLR is the core part of the .NET platform and is hence called the execution engine.
    • Programs written for the .NET Framework execute in a software environment, known as the Common Language Runtime (CLR), an application virtual machine that provides important services such as security, memory management, and exception handling.
    • As we know .NET applications built into Windows form run an executable file by invoking the CLR automatically instead of explicitly invoking the JVM.
    • The CLR provides a “Managed Execution Environment” i.e. It manages the execution of code and provides services that make development easier (like the JVM).
    • CLR provides an environment to execute .NET applications on target machines.
    • MSIL(Microsoft Intermediate Language)/IL/CIL(Common IL) :
      • CLR is a common runtime environment for all .NET code irrespective of their programming language, as the compilers of respective languages in the .NET Framework convert every source code into a common language known as MSIL or IL (Intermediate Language).
      • The .NET Framework is shipped with compilers of all .NET programming languages to develop programs. There are separate compilers for the Visual Basic, C#, and Visual C++ programming languages in .NET Framework. Each .NET compiler produces an intermediate code after compiling the source code. The intermediate code is common for all languages and is understandable only in the .NET environment. This intermediate code is known as MSIL.
      • All .NET source code is compiled to IL. IL is then converted to machine code at the point where the software is installed, or at run-time by a Just-In-Time (JIT) compiler. Source code is compiled into MSIL (Microsoft Intermediate Language) which is similar to Java bytecodes – CPU-independent instructions.
      • MSIL allows for runtime type safety and security, as well as portable execution platforms.
      • The MSIL architecture results in apps that run in one address space, thus using much less OS overhead.
    • CLR also provides various services to execute processes, such as memory management service and security services.
    • CLR also performs various tasks to manage the execution process of .NET applications.
    • The other responsibilities of CLR are listed as follows:
      • Automatic memory management
      • Garbage Collection
      • Code Access Security
      • Code Verification
      • JIT(Just in Time) compilation of .NET code :
        • The JIT compiler is an important element of CLR, which loads MSIL on target machines for execution. The MSIL is stored in .NET assemblies after the developer has compiled the code written in any . NET-compliant programming languages, such as Visual Basic and C#.
        • JIT compiler translates the MSIL code of an assembly and uses the CPU architecture of the target machine to execute a .NET application.
        • JIT also stores the resulting native code so that it is accessible for subsequent calls. If a code executing on a target machine calls a non-native method, the JIT compiler converts the MSIL of that method into native code.
        • JIT compiler also enforces type safety in the runtime environment of the .NET Framework. It checks for the values that are passed to the parameters of any method. For example, the JIT compiler detects any event, if a user tries to assign a 32-bit value to a parameter that can only accept the 8-bit value.
        • During compilation, JIT compilers also produce metadata or glue that binds the code with debuggers, browsers, etc. They may glue definitions of each type in the code, signatures of each type’s members, members that our code references, and other runtime data for the CLR. Metadata in the load file along with the MSIL enables code to be self-describing i.e. no need for separate type libraries, IDL, or registry entries.
        • When code is executed by the CLR, a JIT compilation step occurs.
          • Code is compiled method-by-method to native machine code as methods are invoked.
          • Results in performance slowdown when a program is first executed but can be efficient for code that is never executed.
          • Subsequent invocations reuse compiled code, so no slowdown.
      • Delegates :
        • Delegates is a new concept that is central to the programming model of the CLR.
        • Delegates are like function pointers but are type-safe, secure, managed CLR objects.
        • The CLR guarantees that a delegate points to a valid method.
        • Here, we get the benefits of function pointers without the dangers.
        • Each delegate is based on a single method signature.
        • Commonly used for callbacks.
        • Delegates are the basis of event handlers.
  • Common Type System(CTS)
    • CTS is the core component of the Framework and is a universal type system called the .NET Common Type System (CTS).
    • Everything in the .Net Framework is considered an object.
    • They support Boxing and Unboxing features i.e., the Boxing process is converting an instance of a value type to a reference type. Usually done implicitly through parameter passing or variable assignments. UnBoxing process is casting a reference type back into a value type variable.
    • All types fall into two major categories -Value types and Reference types.
      • Value types contain actual data (cannot be null) that are stored on the stack and always initialized. There are three kinds of value types: Primitives, structures, and enumerations. When instances of value types go out of scope, they are instantly destroyed and memory is reclaimed.
      • Reference types are type-safe object pointers and are allocated in the managed heap. There are four kinds of reference types: Classes, arrays, delegates, and interfaces. When instances of reference types go out of scope, they are garbage collected.
  • The other additional components are –
    • Dynamic Language Runtimes (DLR)
    • .NET Framework Security
    • Side-by-Side Execution
    • Cross-Language Interoperability
    • Application Domains
    • Profiling
    • Runtime Host
    • XML – It is the Metadata or meta-language part of the .Net framework with Self-Describing Components.

Advantage of .Net Framwork Architecture

  • .NET Framework provides enormous advantages to software developers in comparison to the advantages provided by other platforms.
  • .Net Framework provides platform/language independent facilities.
  • They improved reliability and integrated security.
  • They simplified and provide a cost effective development and deployment.
  • It provides language interoperability across platforms i.e. .NET framework supports multiple programming languages in a manner that allows language interoperability(each language can use the code written in some other languages). .
  • It enables a developer to create sharable components to be used in distributed computing architecture.
  • .NET framework supports the object-oriented programming model for multiple languages, such as Visual Basic, Visual C#, and Visual C++.

Disadvantage of .Net Framwork Architecture

  • The .Net framework’s core behaviour can’t be modified.
  • Not all the libraries are supportive for core function.

Use/Application of .Net Framework Architecture

  • The .Net Framwork helps in making –
    • Console applications
    • Windows Forms applications
    • Windows Presentation Foundation (WPF) applications
    • Web applications (ASP.NET applications)
    • Web services
    • Windows services
    • Service-oriented applications using Windows Communication Foundation (WCF)
    • Workflow-enabled applications using Windows Workflow Foundation (WF)

2 Comments

Aman Verma · March 28, 2023 at 10:57 PM

This site is very beneficial for me during exams for theoretical knowledge 👍🏻

    Admin · July 3, 2023 at 7:33 AM

    Thanks a lot for your appreciation and will try to make it more and more better. Thank U.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.