.NET is "Top-level domain originally for network providers"
.NET Definition / .NET Means
The definition of .NET is "Top-level domain originally for network providers"
The Meaning of .NET
.NET means "Top-level domain originally for network providers"
What is .NET
.NET is Microsoft's innovative strategy to simplify building XML Web Services and to develop, deploy, and maintain desktop, enterprise, Internet and Smart devices applications in the Internet age.
The .NET platform is thus a runtime environment on which applications coded in any of the managed languages run. It acts as a software layer between the applications written on the .NET and the operating system. For the time being, the operating systems can be any of the Windows platforms.
ASP.NET is a technology, which works on the .Net framework that contains all web-related functionalities. The .Net framework is made of an object-oriented hierarchy. An ASP.NET web application is made of pages. When a user requests an ASP.NET page, the IIS delegates the processing of the page to the ASP.NET runtime system.
The ASP.NET runtime transforms the .aspx page into an instance of a class, which inherits from the base class page of the .Net framework. Therefore, each ASP.NET page is an object and all its components i.e., the server-side controls are also objects.
Why .NET?The most beauty in .NET is that we don't have to learn a new language to program on the .NET platform. The platform is very much language agnostic and there are only a few syntactical issues to start programming in a language for the .NET platform.
The .NET platform presents us with the following:
Multiple Language Development.
Robust runtime environment, CLR.
Cool Development environment, Visual Studio .NET.
High level of communication among applications.
Support for ubiquitous protocols namely SOAP, XML, HTTP, and HTML.
A huge and powerful class library with over 2000 classes.
.NET framework term .NET framework stands for the collection of technologies that form the development basis for the Microsoft .NET platform.
It is a development and execution environment that allows different programming languages & libraries to work together effortlessly to create Windows-based applications that are easier to build, manage, and deploy.
What is Microsoft .Net Framework
The Microsoft .Net Framework is a platform that provides tools and technologies you need to build Networked Applications as well as Distributed Web Services and Web Applications. The .Net Framework provides the necessary compile-time and run-time foundation to build and run any language that conforms to the Common Language Specification (CLS). The main two components of .Net Framework are Common Language Runtime (CLR) and .Net Framework Class Library (FCL).
Components of .Net Framework
Net Framework is a platform that provides tools and technologies to develop Windows, Web and Enterprise applications. It mainly contains two components,
1. Common Language Runtime (CLR)
2. .Net Framework Class Library.
1. Common Language Runtime (CLR)
.Net Framework provides a runtime environment called Common Language Runtime (CLR). It provides an environment to run all the .Net Programs. The code which runs under the CLR is called a Managed Code. Programmers need not worry about managing the memory if the programs are running under the CLR as it provides memory management and thread management.
Common Language Runtime is the backbone of the .NET framework. CLR takes care of a number of low-level executions such as application hosting, thread handling, memory management, security checks, and application performance. Its primary role is to locate, load, and manage the .NET types (class, array, object, etc.).
Programmatically, when our program needs memory, CLR allocates the memory for scope and de-allocates the memory if the scope is completed.
Features of CLR
- Automatic memory management: - The CLR provides the Garbage Collection feature for managing the lifetime of the object. This relives a programmer from memory management tasks.
- Standard Type System: - The CLR Implement a formal Specification called the Common Type System (CTS). CTS is an important part of rules that ensures that objects written in a different language can interact with each other.
- Language interoperability: - It is the ability of an application to interact with another application written in a different programming language. Language interoperability helps maximum code reuse. The CLR provides support for language interoperability by specifying and enforcing CTS and by providing metadata.
- Platform Independence: - The Compiler compiles code language, which is CPU-independent. This means that the code can be executed from any platform that supports the .Net CLR.
- Security Management: - In the .net platform, Security is achieved through the code access Security (CAS) model. In
the model, CLR enforces the restriction a managed code through the object called “permissions”. The CLR allows the code to perform only that task for which it has permissions. In other words, the CAS model specifies what the code can access instead of specifies who can access resources. - Type Safety: - This feature ensures that the object is always accessed incompatible ways. Therefore the CLR will prohibit a code from assigning a 10-byte value to an object that occupies 8 bytes.
- Class Loader: is an abstract class. Its purpose is to tell JVM in what manner a class is to be loaded at runtime.
- Garbage Collector: The .NET garbage collector enables high-speed allocation and release of memory for the objects in managed code. Its main aim is proper memory management.
- MSIL: Microsoft Intermediate Language is considered to be the lowest form of human-readable language. It is CPU independent and includes instructions of how to load, store, initialize objects. JIT converts this MSIL into native code which is dependent on the CPU.
- Code Manager: Is responsible for managing code at runtime.
- Base class library: It provides all the types that an application needs at runtime.
- Exception Manager: Handles all the exceptions for an application during runtime.
- Type Checker: It enforces the constraints of types. It enforces strictness in type checking.
Benefits of CLR
- Performance improvement
- The ability to easily use components developed in other languages.
- Extensible types provided by the library.
- New Language features such as inheritance, interfaces, etc.
- Complete Object-Oriented design.
- Very Strong Type Safety.
- A good blend of Visual Basic simplicity and c++ power.
- Syntax and keywords are similar to c and c++.
- Use of delegates rather than function pointers for increased type safety and security.
2. .Net Framework Class Library (FCL)
This is also called as Base Class Library and it is common for all types of applications i.e. the way you access the Library Classes and Methods in VB.NET will be the same in C#, and it is common for all other languages in .NET.
The following are different types of applications that can make use of .net class library.
1. Windows Application.
2. Console Application
3. Web Application.
4. XML Web Services.
5. Windows Services.
In short, developers just need to import the BCL in their language code and use its predefined methods and properties to implement common and complex functions like reading and writing to file, graphic rendering, database interaction, and XML document manipulation.
Sub Components of .Net Framework
Common Type System (CTS)
It describes set of data types that can be used in different .Net languages in common. (i.e), CTS ensures that objects written in different .Net languages can interact with each other.
For Communicating between programs written in any .NET compliant language, the types have to be compatible on the basic level.
The common type system supports two general categories of types:
Value types:
Value types directly contain their data, and instances of value types are either allocated on the stack or allocated inline in a structure. Value types can be built-in (implemented by the runtime), user-defined, or enumerations.
Reference types:
Reference types store a reference to the value's memory address and are allocated on the heap. Reference types can be self-describing types, pointer types, or interface types. The type of a reference type can be determined from the values of self-describing types. Self-describing types are further split into arrays and class types. The class types are user-defined classes, boxed value types, and delegates.
Common Language Specification (CLS)
It is a subset of CTS and it specifies a set of rules that needs to be adhered or satisfied by all language compilers targeting CLR. It helps in cross-language inheritance and cross-language debugging.
Common language specification Rules:
It describes the minimal and complete set of features to produce code that can be hosted by CLR. It ensures that products of compilers will work properly in a .NET environment.
Sample Rules:
1. Representation of text strings
2. The internal representation of enumerations
3. Definition of static members and this is a subset of the CTS which all .NET languages are expected to support.
4. Microsoft has defined CLS which are nothing but guidelines that language to follow so that it can communicate with other .NET languages in a seamless manner.
Managed Code
Code developed and running under the control of the CLR is often termed managed code
Microsoft shared the idea of IL code from Java byte code in which IL code can be quickly translated into native machine code. In other words, by compiling to IL code, you obtain platform independence for .NET in much same way as compiling java code.
IL code is compiled (JIT compilation), whereas java byte code was interpreted. One of the advantages of java was that, on execution, the process of translating from java byte code to native executable resulted in the loss of performance. Instead of compiling the entire applications in one go; the JIT compiler simply compiles each portion of code. This is why we can expect that the execution of managed IL code will be as fast as executing native code.
Garbage CollectionThe lower-level high-performance language such as C, C++ is used to clean memory locations for occupied resources manually. For efficiency's sake, it is better that resources are never occupied for longer than necessary, but such a mechanism has one huge disadvantage–the frequency of bugs. Code that requests memory should explicitly inform the system when it is no longer required that memory. Those process often resulting in memory leaks and easily overlooked by implementing the .NET framework feature Garbage Collection.
.NET runtime relies on Garbage Collection to release resources from memory automatically instead. All dynamically requested memory is allocated on the heap so when, .NET detects that the managed heap for a given process is becoming full, it calls the garbage collector. It cleans out the Reference of objects or variable running in current scope stored from heap automatically.
The most important aspect of garbage collection is that it is not deterministic. You can't guarantee when the garbage collector will be called; it would be called when CLR decides that it is needed to release the resources from memory.
Assemblies
An assembly contains CIL (Common Intermediate Code) code, which is conceptually similar to Java byte code. In addition to CIL instruction, assemblies also contain metadata that describes in vivid detail the characteristics of every type in the binary. The .NET metadata is always present within an assembly and is automatically generated by .NET aware language compiler. When a *.exe or *.dll is created using the .NET aware compiler, it is referred to as an assembly.
Assemblies themselves are also described using metadata, which is officially termed as manifest. The manifest contains information about the current version of the assembly, culture information and a list of all externally reference assemblies that required executing the program.
Technically speaking, the .NET assembly is composed of a single file or multiple file assembly. Single file assembly contains all the necessary CIL, metadata and manifest in an autonomous. On the other hand, multiple file assemblies are composed of numerous .NET binaries, each of which is called a module. If you are building an executable desktop application m the *.exe can simply be referred to as an assembly. Likewise, if you are creating a class library, then *.dll would be referred to as an assembly.
The .NET assemblies can categories into Shared Assemblies and Private Assembly. Shared Assemblies are intended to be common libraries that any other application can reference them whereas Private Assemblies are the simplest type, normally ship with software and intended to be used only with that software.
Reflection
It is possible to access the metadata (vivid details about types) from an assembly programmatically using the Reflection mechanism. This method is commonly used to obtain the details of attributes, although you can also use reflection, among another purposes, such as instantiating classes or calling methods.
In this way, you could select classes to instantiate methods to call at runtime, rather than compile-time, based on user inputs (Dynamic Binding). Reflection allows us to perform numerous tasks such as enumerating members of a type, finding out information of types, creating and compiling new assemblies, and inspecting the custom attributes applied to the type.
Security
Security is an essential part of any application and should be taken into consideration from the first stage of the development process. The .NET framework secures the resources by implementing various full-fledged security mechanisms; such as authentication, authorization, code access, role-based security, sandboxing and certificate security. Furthermore, the .NET framework on its own provides you with a set of base classes for implementing confidentiality and integrity through encryption and digital signature.
The .NET allows you to manage security, including how .NET protects you from malicious code, how to administer security policies and how to access the security subsystems programmatically. The .NET framework security mainly revolves around code access security and role-based security.
Code Access Security (CAS) reduces the risks associated with the running code of dubious origin even if code is running under a super user account. It is possible to use CAS to indicate that code should still not be permitted to perform certain types of operations. Whereas Role-Based security is based on the identity of the account under which the process is running, CLR is able to inspect code before running in order to determine required security permissions.
What is Open Source?
This article briefly comments on the platform-independent open-source nature of the .NET framework. When Microsoft released the .NET platform, they crafted a set of formal documents that describes the syntax and semantics of the CIL language which is known as Virtual Execution System. The .NET assemblies can be developed and executed on non-Microsoft operating systems such as UNIX, Mac OS, Linux, FedoraFedora, and other various Linux distributions. The Mono project is an open-source distribution of Common Language Infrastructure that targets various Linux distribution as well as Windows and Mac OS/ iPhone devices.
No comments:
Post a Comment