What is .NET?
.NET is a platform (framework at somehow) for developing and supporting application including web based xml applications.
Developing & Supporting:
Developing means providing the facilities for developing an application and supporting means providing an environment that are necessarily for execution of this code.
Supporting includes all means including OS (Windows 10, 8, 7, Vista, XP SP 3 or greater), Windows Server (2012, 2008, 2003), SQL Server, Visual Studio and so on...
How a source code executes in .NET environment?
A program written in any .NET language, it goes to some processes to execute on .NET environment to produce actual output.
In .NET every language (like C#, VB.NET, F#, J# etc...) that runs on .NET framework, has its own language compiler. When a source code runs, it first compile to Common Intermediate Language (CIL) by its compiler. Then this CIL code is compile by Common Language Runtime (CLR) instead directly execution of this compiled source code to machine native code. CLR converts this CIL code to machine native code (that is understand by the underlying Operating System) and produce the actual ouput.
Actually this process having many benefits instead of directly execution of the compiled source code to machine native code (A code that understandable by underlying OS). It guarantees that code must be run on any windows OS like windows 10, 8, 7, Vista or XP etc and by this the issue of Cross Platform has to be ended (Mono framework). This facility is provided by the CLR. CLR having many other benefits like Garbage collection (GC, also called The Heart of .NET, destroy the variable when its no longer use or when its scope is ended etc.), Run Time Security Checking, Run Time Type Checking (polymorphism) and many more.
Actually this process having many benefits instead of directly execution of the compiled source code to machine native code (A code that understandable by underlying OS). It guarantees that code must be run on any windows OS like windows 10, 8, 7, Vista or XP etc and by this the issue of Cross Platform has to be ended (Mono framework). This facility is provided by the CLR. CLR having many other benefits like Garbage collection (GC, also called The Heart of .NET, destroy the variable when its no longer use or when its scope is ended etc.), Run Time Security Checking, Run Time Type Checking (polymorphism) and many more.
Bird Eye View of .NET Architecture:
A)
CLR provides many services that includes:
- Loading of programs
- Executing of programs
- Memory isolation for application
- Memory management (Garbage Collection)
- Providing metadata (Mono Framework)
- Managing exception and errors
- Verification of type safety
- Run time type checking (Polymorphism, inheritance, interfaces, and overloading)
- Security
- Compilation of IL into native executable code
- Interoperability with other system
CLR provides Security to .NET code (.exe or .dll) like Code Access Security (CAS) is a security technology developed to provide the ability to protect system resources when a .NET assembly is executed. These system resources may includes local files, files on a remote file system, registry keys, databases, printers and so on. Unauthorized access to these types of resources can lead to potential security risks, as malicious code could perform damaging operations on them, such as removing critical files, modifying registry keys, or deleting data stored in databases etc.
The cross-language integration (Objects interact across languages) is also possible because language compilers and tools that target the runtime use a Common Type System (CTS) which also includes Common Language Specification (CLS) defined by the runtime, and they follow the runtime's rules for defining new types, as well as for creating, using, persisting, and binding to types.
(Practice Makes a Man Perfect)


No comments:
Post a Comment