What is Dotnet? let us find out something interested from here in this.
This is how Microsoft describes it: “NET strategy is the Microsoft Web services to connect information, people, systems and devices through software .. Integrated across the Microsoft platform. NET provides the ability to quickly build , deploy, manage and use connected, security-enhanced solutions with Web services .. NET-connected solutions enable companies to integrate their systems faster and more agile and helping them realize the promise of information anytime, anywhere and on any device”.
. NET Framework:
. NET Framework is an environment that facilitates the programming model for multiple object-oriented languages. It wraps the operating system and software development isolated from many of the operating system specific tasks such as file allocation memory management, and management.
It has two main components CLR (Common Language Runtime) for. Net BCL (Base Class Libraries).
As can be seen in the figure. NET Framework is at the top of the operating system, which may be a few different flavors of Windows and is composed of a number of components. . NET is essentially a system application that runs on Windows.
The most important component of the Framework is something called the CLR. If you are a Java programmer, think of the CLR as the equivalent. NET Java Virtual Machine (JVM). If you do not know Java, think of the CLR as the heart and soul of architecture. NET. At a high level, the CLR activates objects, performs security checks on them, leaving them in memory, executes them, and picks up litter. Conceptually, the CLR and JVM are similar in that they are both runtime infrastructures that abstract the underlying platform differences. However, while the JVM currently supports only the Java language, the CLR supports all languages ??that can be represented in the Common Intermediate Language (CIL). The JVM is running bytecode, so technically it could support many different languages, too. Unlike Java bytecode, although IL is not interpreted. Another conceptual difference between the two infrastructures is that Java code runs on multiple platforms with a JVM, whereas. NET only runs on Windows platforms with the CLR (at the time of this writing). Microsoft has introduced the Common Language Infrastructure (CLI), which is functionally a subset of the CLR, to ECMA, so a third party vendor could theoretically implement a CLR for a platform other than Windows.
An assembly is the basic unit of deployment and versioning, which consists of a manifesto, a set of one or more modules, and an optional set of resources.
. NET portable executable:
A Windows executable, EXE or DLL, you must adjust to a file format called the PE file format, which is a derivative of the Microsoft Common Object File Format (COFF). Both formats are fully specified and publicly available. The Windows operating system knows how to load and execute DLLs and EXE, and you understand the format of a PE file. Given this, any compiler that wants to generate Windows executables must obey the specification of PE / COFF.
Standard Windows PE files are divided into two main sections. The first section includes the headers PE / COFF referring to content in the PE file. In addition to the section header, the PE file has a number of native image sections, including the data.,. Rdata,. Rsrc and sections. Text. These are the usual sections of a typical Windows executable file, but Microsoft’s C / C + + allows you to add your own custom sections in the PE file by a compiler pragma statement. For example, you can create your own data section for storing the encrypted data can only be read. Leveraging this capability, Microsoft has added some new sections to the normal PE file specifically to support the functionality of the CLR. The CLR understands and manages the new sections. For example, the CLR will read these sections and determine how to load classes and execute your code at runtime.
The sections that Microsoft has added to the normal PE format is the head of CLR and CLR data sections. While the CLR header stores information indicating that the file is a PE executable. NET CLR data section contains metadata and IL code, both of which determine how the program will run.
Metadata is machine-readable information about a resource, or “data about data”. Such information could include details on the content, format, size or other characteristics of a data source. In. NET, metadata includes type definitions, version information of assembly, external references, and other standardized information.
With the end of two components, systems, or objects to interact with each other, at least one must know something about the other. In COM, that “something” is an interface specification, which is carried out by a component supplier and used by consumers.
In. NET, metadata is a common mechanism or dialect runtime. NET, compilers and tools can be used all. Microsoft. NET uses metadata to describe all types that are used and exposed by an individual. NET. Metadata includes the description of an assembly and modules, classes, interfaces, methods, properties, fields, events, global methods, and so on.
. NET assemblies are units of deployment and the manifest is the metadata that describes the assemblies.
An assembly contains the IL code that runs on the CLR runtime. The IL code commonly used types defined within the same assembly, but you can use or refer to other types of assemblies. There is one caveat: each set can have at most one point of entry, such as DllMain (), WinMain () or Main (). You must follow this rule, because when the CLR loads an assembly, look for one of these entry points to start the execution of assembly.
There are four types of assemblies in the network.:
Static assemblies: These are the NET PE files that are created at compile time .. You can create static assemblies through your favorite compiler: csc, cl, or VBC.
Dynamic sets: These are PE-formatted, in memory assemblies that you dynamically create at runtime using classes in the System.Reflection.Emit namespace.
Private assemblies: These are static assemblies used by a specific application.
Public meetings or shared: They are static assemblies that must have a unique name shared and can be used by any application.
The CLR allows any versions of the same-shared DLL (assembly) to run simultaneously on the same system, and even in the same process. This concept is known as running from side to side.
Manifests: Assembly Metadata
An assembly manifest is metadata that describes everything about the meeting, including their identity, a list of files belonging to the assembly, references to external assemblies, exported types, exported resources, and permit applications. In summary, we describe all the details required for the component plug-and-play. Since a set containing all these details, no need to store this information in the registry, as in the COM world.
A set can be a single module or a whole multi-module assembly. In an assembly of a single module, all in a generation were grouped into a single EXE or DLL, an example of which is the application we have previously hello.exe. This is easy to create because a compiler is responsible for creating the assembly of a single module for you.
A multi-module assembly is one that contains many modules and resource files. To create is to use the Assembly Linker (Al.exe) provided by the SDK. NET. This tool takes one or more files or resources IL and spits out a file with an assembly manifest.
Any language. NET can be converted to IL, so. NET supports multiple languages ??and multiple platforms perhaps in the future (as long as the target platforms have a CLR).
The Common Type System (CTS):
Due to. NET treats all languages ??equally, a class written in C # should be equivalent to a class written in VB.NET, and an interface defined in C + + application must be exactly the same as one specified in managed COBOL. Languages ??must agree on the meanings of these concepts before they can integrate with one another. In order to make language integration a reality, Microsoft has specified a common type system to which all languages. NET must be met.
Interfaces support exactly the same concept as a C + + abstract base (ABC) with only pure virtual functions. ABC is a class that declares one or more pure virtual functions and therefore can not be instantiated. If you know COM or Java interfaces. NET are conceptually equivalent to a COM or Java interface. You specify, but not implement them. A class that is derived from the interface must implement the interface. An interface can contain methods, properties, indexers, and events. In. NET, a class can derive from multiple interfaces.
The Common Language Specification (CLS):
Microsoft has released the Common Language Specification (CLS). The CLS specifies a set of basic rules that are required for language integration. Since Microsoft provides the CLS that spells out minimum requirements for a language. NET compiler vendors can create their compilers to provide specification and target languages. NET. In addition to compiler writers, application developers should read the CLS and use its rules to ensure interoperability of language.
EP. Net files (metadata and IL) >> Class Loader Verifier JIT >>>>>> native managed code
Once the class loader has found and loaded the target class, it stores the information of a class so you do not have to load the class again for the duration of this process.
The verifier is responsible for verifying that:
1. Metadata is well formed, ie, the metadata must be valid.
2. The IL code is type safe, ie, type signatures are used properly.
The JIT compilers convert IL to native code so that it can run on the target operating system. For optimization reasons, JIT compilation only occurs the first time a method is invoked. Recall that the class loader adds a stub to each method of the class during charging. In the first method invocation, the VEE reads the information in this piece, said that the code for the method has not been JIT compiled. In this indication, the JIT compiler compiles the method and injects the direction of the native method given in this piece. During subsequent calls to the same method, no JIT compilation is necessary because each time the VEE to read the information in the heel, which is the direction of the native method. Because the JIT compiler only performs its magic the first time you invoke a method, methods that do not need at runtime JIT will not compile. The compiled code is native in memory until you close the process and until the garbage collector clean of all references and memory associated with the process. This means that the next time you run the process or component, the JIT compiler will do its magic.
If you want to avoid the cost of JIT compilation at runtime, you can use a special tool called ngen, which compiles the IL during the time of installation and configuration. Using ngen, JIT can compile the code once and cached on the machine so you can avoid JIT compilation at runtime (this is known as pre-JITting). In the event that the PE has been updated, the PE should PreJIT again. Otherwise, the CLR can detect dynamic update and order the appropriate JIT compiler to compile the assembly.
All meetings. NET components are essentially binary. You can try each assembly. NET as a component that can be connected to another component or application without source code, since all the metadata for the component is stored within the assembly. NET. While you have to do a lot of pipes to build a COM component, you need to do extra work to get a zero component. NET, as all meetings. NET are components of nature. Remember, we are using the term “component” as a binary unit of deployment, not as a COM class.
Unlike private applications, shared sets – which can be used by any client application must be published or registered in the system cache Global Assembly (GAC). When you register against the assemblies in the GAC, they act as system components, such as a system DLL that every process in the system can use. A prerequisite for GAC registration is that the component must have information about the version and author. In addition to other metadata, these two elements allows multiple versions of the same component to be registered and executed on the same machine. Again, unlike COM, we have to store any information in the system registry for clients to use these shared assemblies.
Grouping of objects:
A pool is a technical term that refers to a resource group, such as connections, threads, and objects. Put a few objects in a pool allows hundreds of clients to share these few objects (you can make the same claim for threads, fittings and other objects). Group therefore is a technique that minimizes the use of system resources, improves performance and helps system scalability.
Model Microsoft ADO.NET ‘s object covers two distinct groups of classes: content components and management components and provider. Components include the contents of the DataSet class and other support, such as DataTable, DataRow, DataColumn, and DataRelation. These classes contain the actual content of a data exchange. Managed provider components assist in data retrievals and updates. Microsoft provides two managed providers in your current version of ADO.NET: OLE DB and SQL. The OLE DB managed provider comes with OleDbConnection, OleDbCommand, OleDbParameter and OleDbDataReader. The SQL Server managed provider comes with a similar set of objects whose names start with SqlClient instead of OleDb. Developers can use the connection, command and data reader objects to directly manipulate the data.
We might think that the creation and tear down connections is not a good idea since the cost of establishing a connection is usually high. This is a concern only in the absence of the connection pool. ADO.NET automatically keeps connections to a data source in a pool, so when an application creates a connection that is breaking down, is actually returning it to the resource group. This allows connections to be reused, avoiding the cost of reconstruction of new connections from scratch.
Because ADO.NET framework classes are managed code, developers can inherit and extend these classes to your personalized needs.
A data reader is a new object providing fast, forward-only and read-only access to data. This is similar to an ADO Recordset with server-side, forward – only and read-only cursor types. As this is a server side cursor, the connection to the server is open throughout the reading of data.
Even though each DataAdapter maps only one DataTable in the DataSet, you can have multiple adapters to fill the DataSet with multiple data tables. Managed code:
The framework. Net provides several core run-time services to the programs that run within it. For example, exception handling and security. For these services to work the code must provide a minimum level of information at runtime. This code is called managed code.
The data used:
This is data for which is performed by the memory management. Garbage collector net runtime that includes tasks for allocation of the assignment. We can call garbage collector to collect the data references the United Nations through the implementation of System.GC.Collect ().
What is an Assembly?
Assemblies are the fundamental building blocks of. Net Framework. They contain the type and the resources that are useful for making an application. Assemblies enables code reuse, version control, security and deployment. An assembly comprising: Manifesto type metadata, MSIL and resource file.
Assemblies are Private and Shared. Private are used for a single application and is installed in the installation directory of the application or its sub-directories. Shared assembly is one that can refer to multiple applications and resides in the GAC (local cache for assemblies managed by the. Net Framework).
gacutil / i myDll.dll can see and% windir% \ assembly
Metadata and show:
Manifest describes the assembly itself. Assembly name, version, culture, strong name, list of files, type reference and the reference set. While metadata describing the content within the assembly, such as classes, namespaces, interfaces, scope, properties, methods and parameters, etc.
The application domain:
It is a virtual process that serves to isolate an application. Any object created within the scope of the application itself is created within the same application domain.
It’s automatic memory manager. Net Framework. Manages the memory allocated. Net Framework.
When a variable is defined it gets a memory space (stack) and when you create a memory object for the object is allocated on the heap. When an object is assigned to a variable increases the reference count for the object and when program control comes out of the reach of the function of the variable is null terminated or assigned to the variable that decreases the reference count Object 1. When the reference count of an object becomes zero GC acts call destructor of the object and then releases the memory acquired by the object.
Can. NET can be used from a COM?
Itself, can be used. However, there are few restrictions, such as a COM object has to be created. So the static methods, parameterized constructor can not be used from COM. These are used by using a wrapper COM COM callable (CCW).
Tlbimp.exe and Tlbexp.exe
How it works. NET Remoting work?
It comes to sending messages through channels. Two of the standard channels are HTTP and TCP. TCP is for LANs and HTTP can be used in LAN or WAN (Internet). TCP uses binary serialization and HTTP uses SOAP (. Net runtime serialization in SOAP Formatter).
There are 3 styles of remote access:
SingleCall: Each incoming request is handled by a new instance.
Singleton: All applications are handled by single object server.
Client-activated object: This is the old state-full DCOM model. When the client receives remote object reference and maintain until the end with her.
Situations where we have to put same name Dlls in single directory which dlls are of different versions.
Boxing and boxing-A:
Implicit (automatic) conversion of value type reference type is called boxing and explicit (manual) conversion reference rate to the value type is said to be Un-boxing. (Conversion of the integer variable with the type of object)