1 / 52

Unit -1 Chapter -1

Unit -1 Chapter -1. REVIEW OF .NET FRAME WORK. Topics to be covered. Introduction to .NET framework the Microsoft .NET strategy. Why is .NET? . NET product. .NET services. The origin of .NET technology. Brief history of .NET. The .NET framework application.

aman
Download Presentation

Unit -1 Chapter -1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unit -1Chapter-1 REVIEW OF .NET FRAME WORK

  2. Topics to be covered • Introduction to .NET framework • the Microsoft .NET strategy. • Why is .NET? • .NET product. • .NET services. • The origin of .NET technology. • Brief history of .NET. • The .NET framework application. • The core feature of .NET framework. • Benefits of the .NET approach: • .NET framework 4.0 architecture(introduction and feature). • Feature of .NET framework and asp.net 4.0

  3. 6. Execution environment of .NET framework application. (1). Common language runtime(CLR). • Source code • Compiler. • Metadata. • Microsoft Intermediate language(MSIL). • Managed code. • Class loader. • Base class library or.net framework class library. • Just in time compiler(JIT). • Native machine code. • Runtime manager. • NET Assembly • Kinds of assemblies-private and shared. • Component of assemblies- manifest, module, type • Function of assemblies.

  4. (2). Common language specification(CLS). (3). Common type system(CTS). (4). Garbage collector(GC). (5). How the garbage collector works. (6). Namespace

  5. The Microsoft .NET strategy. • Microsoft wanted to make the www more vibrant by enabling individual devices, computers and web services to work together intelligently to provide richer solution to the users. • By the intelligent ,integration of website on the internet, user can create a wide variety of value based applications such as unified banking services, electronic bill payment etc. • Microsoft calls this “web services” and the software strategy for implementing and delivering those services as “.NET”

  6. Contd…. • .NET is a software framework that includes everything required for developing software for web services. It integrates presentation technologies,componet technologies and data technologies on a single platform so as to enable users to develop internet application as easily as they do desktop system.

  7. Why .NET? • The world of computing till date has been chaotic. We have had various languages struggling to interoperate with each other, developers undergoing huge learning curves to shift from one language to another or from one application type to another, non-standard ways of modeling applications and designing solutions and huge syntactic differences between languages. The list goes on.... • Basically,microsoft introduce the .NET framework with the intention of bridging the gap in interoperability between application.

  8. Contd…. • This framework aim at integrating various programming languages and services. • It is designed to make significant improvement in code reuse, code specification, resource management,multilanguage development, security deployment and administration. • It consist of all the technologies that help in creating and running robust scalable and distributed applications. • The .NET offers a complete suite for developing and deploying applications.

  9. Contd….The Microsoft .NET software solution strategy(suit) includes three key approaches: MS.NET STRATEGY MS .NET PLATFORM MS.NET PRODUCT AND SERVICES THIRD PARTY .NET SERVICES

  10. Contd…. • MS .NET platform includes the following component that would help developing a new generation of smart internet services, and they are:- • .NET infrastructure and tools .NET framework. • .NET user experience console application, windows application, libraries etc. • .NET building blocks CLR,CTS,base class etc. • .NET device software embedded system.

  11. contd.. • Microsoft .NET product and services consist of the following:- • Windows .NET. • MSN .NET. • Office .NET. • Visual studio .NET. • Personal subscription services. • bCentral for .NET.

  12. Contd… • Third-party .NET services: Third-party .NET services will provide opportunities to vast range of developers and users to produce corporate and vertical services using .NET platform. • The third-party languages are:- • COBAL • Smalltalk • Mercury • Perl • Python • Native languages are:- • VB • C++ • C#

  13. Brief history of .NET • The Microsoft .Net is a new internet technology or rather strategy introduced by Microsoft. .Net was originally known as the NGWS (Next Generation Windows Services) which was said to be an Internet based platform of Next Generation Windows Services. Before the official announcement of .Net, NGWS was the term used to describe the above phrase. • The .NET Framework was first released in in November 2000 and development continues today. Each version of the framework has betas, final versions, service packs, and patches associated with it.

  14. The origin of .NET technology Note: Before going into the detail of .NET feature further, we shall see how the concept of .NET was evolved over the past 10 years by Microsoft corp. • The current technology of .NET has gone through three significant phases of development. and they are:- OLE TECHNOLOGY Object linking and embedding (early phase-I 1990s) Interprocess communication COM TECHNOLOGY Intermodule communication Component object module or model (phase-II 1995) .NET TECHNOLOGY Phase-III 1990’s later years Intersite communication

  15. Contd… • Interprocess communication more than one independent process communicate with each other. Ex: crystal report with VB or VB.NET. • Intermodule communication integration of independent component or module developed in a particular language with each one is offering a particular service: VB 6.0 module ,java classes or packages etc. • Intersite communication cross language compatibility i.e. module developed in any language included in .NET package can be merged together to create an application.

  16. .NET Technology • .NET technology is a third generation component model. • This provides a new level of interoperability compare to COM technology. • COM provides a standard binary mechanism for intermodal communication. This mechanism is replaced by an intermediate language called Microsoft Language (MSIL) or simple IL in the .NET technology. • Various .NET language compiler enforce inter-operability by compiling code into ILs which is automatically compatible with other IL modules. • An inherent characteristics of IL code is metadata.

  17. Monolithic approach vs .NET platform linking compile Source code Object code execution .NET TECHNOLOGY csc JIT Source code Manage code Exe/dll code Native code CLR (loading, running and checking IL

  18. The .NET framework • The .NET framework is one of the tools provided by the .NET infrastructure and tool component of .NET platform. • .NET platform provides a new environment for creating and running robust, scalable and distributed applications over the web. • C# derives much of the power from the .NET framework on which it runs. • The .NET framework provides an environment for building, deploying and running web services(ASP.NET) and other application (windows application). • It is an important component that supports building and running the advanced application and XML services.

  19. .NET PLATFORM NET INFRASTRUCTURE AND TOOLS .NET BUILDING BLOCK SERVICES .NET DEVICE SOFTWARE VISUAL STUDIO .NET .NET EXPERINCE SERVICES WINDOWS .NET .NET FRAMEWORK .NET USER EXPERENCE .NET INFRASTRUCTURE AND TOOLS • .NE WINDOWA .NET FRAMEWORK It consist of three distinct technologies: CLR, framework base class and the top layer consist contains a set of classes for developing web services and to deal with the user interface. WINDOWS FORM WEB SERVICES WEB FORMS DATA & XML CLASSES (ADO.NET,SQL) FRAMEWORK BASE CLASS (I/O, STRONG SECURITY, COLLECTION ETC) .NET FRAMEWORK ARCHITECTURE. COMMON LANGUAGE RUNTIME (DEBUG,EXCEPTION HANDLING,TYPE CHECKING,JIT,COMPILEER) WINDOWS PLATFORM

  20. .NET Framework C# VB.NET C++.NET Other Visual Studio .NET Common Language Specification Framework Class Library ASP.NET Windows Forms Web Services Web Forms Controls Drawing ASP.NET Application Services Windows Application Services ADO.NET XML Threading IO Network Security Diagnostics Etc. Common Language Runtime Common Type System Lifecycle Monitoring Memory Management Operating System

  21. The core feature/objectives of .NET framework. • Provide a better execution environment for reducing versioning conflicts and saving the deploying time. • Provide a safe execution environment. • Provide an object- oriented programming environment. • Provide a consistent API as well as consistent experience to developer across widely varying types of applications such as windows-based applications and web based applications. • Provide integrity with different type of code. • Elimination of the performance problems of scripted or interpreted environment. • it is a complete set of tools for building ASP web application,xml web services, desktop application and mobile application. • VB .NET,VB C++ .NET, VB C#.NET and VB J# .NET all uses the same integrated development environment (IDE),which allows them to share tools and facilities in the creation of mixed-language or cross language solution.

  22. .NET framework 4.0 architecture (feature). • Enhanced globalization. • Garbage collector. • Code contracts. • Design-time-only interop(interoperability) assemblies. • Memory –mapped files.

  23. Feature of .NET framework and asp.net 4.0 • The main feature are:- • Enhanced syntax for Html encode. • Enhanced on Microsoft Ajax library. • Session state compression. • Output cache extensibility. • View sate mode for individual controls. • Auto start asp.net application. • Jquery integration.

  24. Execution environment of .NET framework application. 1. ). Common language runtime(CLR). • Source code • Compiler. • Metadata. • Microsoft Intermediate language(MSIL). • Managed code. • Class loader. • Base class library or.net framework class library. • Just in time compiler(JIT). • Native machine code. • Runtime manager. • NET Assembly • Kinds of assemblies-private and shared. • Component of assemblies- manifest, module, type • Function of assemblies.

  25. Common language runtime(CLR). COMPONENTS OF COMMON LANGUAGE RUNTIME(CLR) • The common language runtime(CLR) is one of the most essential component of the .NET framework. • CLR is a runtime environment in which all the programs using .NET technologies are executed. • It also support cross language compatibility. COMMON TYPE SYSTEM(CTS) INTEMIDIATE LANGUAGE(IL) EXECUTION SUPPORT FUNCTION SECURITY GARBAGE COLLECTION CLASS LOADER MEMORY LAYOUT

  26. Contd.. • The CLR provides services such as:- • Loading and execution of programs. • Memory allocation and memory isolation for application. • Verification of type safety. • Compilation of IL into native executable code. • Providing metadata. • Memory management(automatic garbage collection) • Enforcement of security. • Interoperability with other systems. • Managing exceptions and errors • Support for tasks such as debugging and profiling.

  27. Source code Assembly Contd…Flowchart of CLR activities for executing a program Managedcode compiler IL and Metadata Metadata Engine linkers Other native code Exe code Class loader Basic class library Verifier test For type safety JIT compiler Native machine code Runtime manager output

  28. Contd… • While executing the program CLR plays an important role: • The source code is compiled to IL while the metadata engine creates metadata information. • IL and Metadata are linked with other native code if required and the resultant IL code is saved. • During execution, the IL code and any requirement from the base class library are brought together in the class loader. • The combined code is tested for type-safety and then compiled by the JIT compiler to produce native machine code, which is sent to runtime manager for execution.

  29. Contd… • Source code:- • Initially, a programmer writes a program in a particular programming language. This form of the program is called the  source code or sourceprogram. • Compiler:- • A compiler is a special program that processes statements written in a particular programming language and turns them into machine language or "code" that a computer's processor uses. • When we compile a program developed in a language that targeted the CLR instead of compiling the source code into machine-level code, at that time the compiler translates the source code into Microsoft intermediate language(MSIL) • This ensure language interoperability.

  30. Microsoft intermediate language(MSIL) • MSIL or simple IL, is an instruction set into which all the .NET programs are compiled. • It contains instructions for loading,storing,initializing and calling methods. • It is low level language that the CLR understands. • When we compile any program written in a CLS-compliant language, the source code is complied into MSIL. • In addition to IL,.NET includes a host of other technologies and tools that will enable us to develop and implement web-based application easily.

  31. Metadata • Metadata is data about data and it contains the description of code such as data types, classes and interface dependencies, location and the versions of the components used in the application. • It also defines the properites,methods and events associated with each member type. • It allows for true cross language integration. • It is always the job of the compiler not the programmer to produce the latest type metadata. • Metadata is used by the CLR complaint compilers to read many aspects of the application in .NET runtime environment.

  32. SOURCE CODE IL METADATA IL and metadata constitute as assembly. • Assemblies contain metadata ,which describe the assembly’s internal version number and details of all the data and object type they contain. • When we compile a an V.S complaint application, visual studio .NET create an assembly that is a single file with the extension .exe or .dll. + COMPILER ASSEMBLY

  33. .NET Assembly • The net assembly is the standard for components developed with the Microsoft .NET . • The .NET assemblies may or may not be excutable,i.e they might exist as the executable (.exe) file or dynamic link library (dll) file. • All the .NET assemblies contain the definition of types, versioning information for the type,meta-deta and manifest. • The assemblies can be used by single or multiple applications. • An assembly can be a single file or it may consist of the multiple files. in case of multi file, there is one master module containing the manifest while other assemblies exist as non manifest modules. • A module in .NET is a sub part of a multi file .NET assembly. Assembly is one of the most interesting and extremely useful areas of .NET architecture along with reflections and attributes.

  34. Component of assemblies- manifest, module, type Manifest Manifest: describe the assembly ,it contains information like name and version number of the assembly, security permission required by the assembly. Module: is either a dll or exe file. It contains IL and metadata. Type : is a class that contains data and logic affecting the data. These class contains information like propreties,fields and methods. module Metadata IL code type Properties , field, method

  35. Kinds of assemblies-private and shared. • There are two kinds of assemblies in .NET described below; • 1. private assemblies: private assemblies are simple and normally used by a single application, and are stored in the application’s directory. These assemblies are often used to deploy language-specific assemblies work in side-by-side execution because the application has a separate product id for each language and installs satellite assemblies in a language specific subdirectory for each language. • 2. shared assemblies: a shared assembly is normally stored in the global assembly cache, which is a repository of assemblies maintained by the .NET runtime. for all calling assemblies within the application, the same copy of the shared assembly is used from its original location. Hence shared assemblies are not copied in the private folders of each calling assembly. Each shared assembly has a four part name including its face name, version ,public key token and culture information. the public key token and version information makes it almost impossible for two different assemblies with the same name or for two similar assemblies with different version to mix with each other.

  36. Function of assemblies. • Supports execution. • Provides security • Support deployment. • Provide unique identification. • Tracks version.

  37. Managed code • As we know that CLR is responsible for managing the execution of code compiled for .NET platform. • The code that satisfies the CLR ,the foundation of the .NET Framework at runtime in order to execute is referred to as managed code. • Managed code supplies the metadata necessary for the CLR to provide services such as memory management, cross-language integration, code access security, and automatic lifetime control of objects. All code based on IL executes as managed code. • Compiler that are compatible to .NET platform generates managed code • The managed code generated by compiler is called IL code.

  38. Class loader • When we execute the .exe or .dll file, the code which is converted into IL and all the other relevant information from the base class library is sent to class loader. • The class loader loads the code into the memory.

  39. Base class library or.net framework class library. • The .NET framework class library is a collection of reusable types that tightly integrated with the CLR. • These are inbuilt classes which makes development very easy. • The .NET class library is unique for framework that means we have to study it once and we use it for any .NET language based application development. • These are object oriented class from which our own manage code can derived functionality. • It enable us to accomplished range of common programming task such as data collection,database connectivity, string management etc. • We can use class library for development of console application,windowsapplication,ASP.NETapplication,XML web services etc.

  40. JIT-manage code execution • Before the code can be executed, the .NET framework needs to convert the IL into native or CPU-specific code. • The just-in-time complier translates the code from IL into managed native code. • During the process of compliation,the JIT compiler compiles the code that is required during execution instead of compiling the complete IL code. • When an uncompiled method is invoked during execution, the JIT compiler converts the IL for that method into native code. • During JIT compilation, the code is also checked for type safe.

  41. Type-safe • This feature ensures that the objects are always accessed in compatible way. Therefore, the CLR will prohibit a code from assigning a 10-byte value to an object that occupies 8-byte. • Type safety also ensures that objects are safely isolated from each other and therefore safe from any malicious corruption.

  42. Native machine code • Native code is computer programming (code) that is compiled to run with a particular processor and its set of instructions.

  43. Runtime manager • After translating the IL into native code,the converted code is sent to the .NET runtime manager. • The .NET runtime manager executes the code. • While executing the code, a security check is performed to ensure that the code has the appropriate permission for accessing the available resources.

  44. .NET platform-Security management • In case of .NET platform, security is achieved through the code access security(CAS) model. • In this model, the CLR enforces restriction on managed code through the use of object called permission. • The CLR allow the code to perform only those tasks for which it has permission. • In other words, the CAS model specifies what the code can access instead of specifying who can access resources.

  45. 6. Execution environment of .NET framework application…CONTD… (2). Common language specification(CLS). (3). Common type system(CTS). (4). Garbage collector(GC). (5). How the garbage collector works. (6). Namespace

  46. Common type system(CTS) • The .NET framework provides multiple language support using the features known as common type system(CTS) that is built into CLR. • CTS support a variety of type and operation found in most programming languages and therefore does not required type conversion. • CTS defines how data types are declared, used and managed in the code at runtime. • The CTS also defines the rules that ensure that the data types of objects written in various languages are able to interact with each other.

  47. Common language specification(CLS) • CLR consists of a set of common rules followed by all the languages of the .NET framework. This set of rules is known as common language specification(CLS). • CLs defines a set of rules that enables interoperability on the .NET platform. • These rules serves as a guide to the third-party compiler, designers and library builders. • CLS enable an object or application to interact with the object or application of other language. • The class that follow the rules specified by CLS are termed as CLS compliant class. • The classes defined in the .NET framework class library are CLS compliant.

  48. Garbage collector(GC). • The garbage collector is a tool for memory management provided by .NET framework. • The garbage collector(GC) runs in a low-priority thread and checks for un-reference dynamically allocated memory space. • If it finds some data that is no more referenced by any variable/reference, it re-claims it and returns the occupied memory back to the operating system so that it can be used by other programs as necessary. • The presence of standard garbage collector free the programmer from keeping track of slack data.

  49. How the garbage collector works. • The garbage collector examines how objects are arranged in memory and identify all those objects that can be used by the running programme by using some references. When a garbage collection starts ,it looks at a set of references called the ‘gc roots’. These are memory locations that are designated to be always reachable for some reason, and which contain references to objects created by the program. It marks these objects as ‘live’ and then looks at any objects that they refrence;it marks these as being ‘live’ too. It continues in this manner, iterating through all of the object it knows are ‘live'. it marks anything that they reference are also being used until it can find no other objects. • An object is identified, by the garbage collector, as referencing another object if it, or one of its super classes that contains the other object. once all of these live objects are known, any remaining objects can be discarded and the space can be re-used for new objects. the net reduces memory so that there will be no gap which means that free memory is always located at the end of a heap and makes allocating new objects very fast. If an object has a finalizer,it is not immediately removed when the garbage collector decides it is no longer ‘live'. these objects usually require more than one garbage collection to be removed from memory, as they will survive the first time they are found to be unused.

More Related