MyblogAd

Sunday, March 16, 2014

INTRODUCTION TO .NET FRAMEWORK

.NET framework is build by microsoft for developer to develope complex enterprise application with more ease. In this section we will see the building blocks of .net framework , which will give a brief idea of different types of applications that can be created and the execution cycle of an application that can be created in any .net compatible language,what i mean to say is ,with .net framework we can build different application like web based, windows based, data centric, very rich GUI using windows presentation foundation(wpf),web services and so on can be created and the best part is,these application can be executed on any platform,which is the need in todays world. -: COMPONENTS OF .NET FRAMEWORK :- Now, it's time to see the components of framework so, let's have a look at the figure1.1. .net framework consist of different components and each components has different role to perform. -: COMMON LANGUAGE RUNTIME(CLR) :- As I explained to you earlier that, different types of applications can be created using .net framework and to execute these application on any device CLR plays very important role as CLR is one which executed the application . It is also known as execution engine or heart of .net framework. -:FRAMEWORK CLASS LIBRARY (FCL):- FCL consists of classes that all application can use to develop user interface, web pages or access database. It also contain core classes which provide basic functionality like collections,security,xml support etc. -:COMMON LANGUAGE SPECIFICATION(CLS):- language to become .net compatible language, every language has to follow certain rules and that rules are defined in common language specification. -:COMMON TYPE SYSTEM(CTS):- A code written in one language can be used in a code written in another language. This becomes possible because of CTS . It also define common datatypes so that the code become interoperable. -: MICROSOFT VISUAL STUDIO .NET :- Any .net application can be created by using visual studio .net INTEGRATED DEVELOPER ENVIRONMENT (IDE) Tool. It also provides in-built application templates and tools for building .net application. Now I would like to tell you all that , what are the key features of languages which are supported by .net the key features are: 1. It's standardization by ECMA(EUROPEAN COMPUTERS MANUFACTURERS ASSOCIATION) CLS has been accredited by ECMA which is the official international standard. This helps third parties to build their .net distributions on other operating systems. 2. Object-Oriented: As all the .net compatible languages are objet oriented hence,provide pure object oriented solutions to real world problems. . 3.Component based: reusable piece of code is known as component. It can be created by using any.net language and can be used by any.net application. Now we will see the concept of interoperability...... Each language is unique in terms of strength and compatibilities . Some offers good support for advanced mathematics processing , some for logical calculation , financial calculation, etc.. The strength of any language combined with .net framework create a win win situation. Any object in c# can interact with other object in vb.net or j# . Even the type in one language can extend the functionalities of type present in another language. This approach facilitates language interoperability. Common language specification (CLS) defines rules for the language compiler. It is a subsetof the common type system (CTS). The CTS defines the rules concerning datatypes. They together ensure language interoperability and faster application development. Now next part is the execution of .net application........see figure 1.2 A code written in a perticular .net language is first compiled by language specific compiler and then, MSIL(microsoft intermidiate language) code is generated , MSIL code is platform neutral, which means , this code can be executed on any platform. To do this CLR is required.. CLR convert the MSIL code into platform dependent code. But, the point to note here is, .net source code is compiledtwice before execution -first by language specific compiler and then by just-in-time compiler, which is a component of CLR. ....there are few terminology associated with the execution... -: MANAGED CODE :- By default , every code written using any of the .net languages like c# or vb.net is a managed code as this code is managed by CLR. .Net applications when compiled convert this code into a language neutral non executable code called MSIL. -: MANAGED DATA :- Every data required by any .net application while execution is allocated and de-allocated by CLR. This data is referred to as managed data and the heap where these objects are created or reside is termed as managed heap. One of the core service provided by CLR is garbage collection. By providing this service, CLR automatically takes care of cleaning up the memory while freeing the resources. Assembly Loader assembly loader is one of the components of CLR . It first locate the assembly which contains main() and then loads it into memory . It also locates and loads other class from FCL which are referenced in the code. CODE VERIFIER It is the core component of CLR. It verifies MSIL code to check permission against trust policies definec in .net environment. This concept is called code access security , with the help of code verifier and security configuration .net environment can prevent execution of unsafe code. In short it verifies wheather the code is secure code to execute. JUST-IN-TIME COMPILER (JIT) when a method is invoked , the JIT compiler analyzes the MSIL code and produces highly efficient machine code . It also checks the information weather the code is compiled or not and if the code is not compiled then its compiles only the code that is not yet converted to native code. There are three types of JIT compilers:- 1. STANDARD JIT :- it is used in development of application as mentioned above. 2. Pre JIT - it compiled MSIL during installation and setup time. 3. Econo JIT - it is used for mobile applications. ASSEMBLIES Assembly is a logical unit of deployment.. The main components of assembly are:- 1. Manifest -it contains the assembly information such as, version,security,identity and references to other assemblies and also contains a list of files present in the assembly. 2. Type metadata-metadata provides information about all types defined in the assembly such as classes , interfaces, properties, methods, delegates , events etc.. 3. MSIL code-this is the microsoft intermediate lanaguage code . Before the code is executed , JIT compiler of CLR converts it to CPU specific native code. 4. Resources - resources like image resources i.e .bmp and .jpg . Files and general allocation is one resources file per application.

No comments:

Post a Comment