Presentation is loading. Please wait.

Presentation is loading. Please wait.

History of.Net Introduced by Microsoft Earlier technology was VC++ and VB VC++ comes with so many library and VB was so easy to use and not flexible to.

Similar presentations


Presentation on theme: "History of.Net Introduced by Microsoft Earlier technology was VC++ and VB VC++ comes with so many library and VB was so easy to use and not flexible to."— Presentation transcript:

1

2 History of.Net Introduced by Microsoft Earlier technology was VC++ and VB VC++ comes with so many library and VB was so easy to use and not flexible to develop a serious application Good competition from Sun’s java and j2ee.Net resolved all this problem

3 .Net Application Window based application Web based application Console Application Web Services In Web Services, software functionality becomes exposed as a service

4 Framework, Languages, And Tools Base Class Library Common Language Specification Common Language Runtime ADO.NET: Data and XML VBVC++VC# Visual Studio.NET ASP.NET: Web Services and Web Forms JScript… Windows Forms

5 .Net Framework A component that provides facility to build and run an application Intermediate layer between OS and Programming Language Not an OS, Not a Language Supports many programming languages, including VB.NET, C# etc Operating System + Hardware.NET Framework.NET Application

6 .Net Framework Cont…  Two main part of.Net Framework o Common Language Runtime o Base class library

7 Common Language Runtime (CLR) Runtime execution environment Manage and execute code written in any.net language Runtime is an agent that manages code at execution time, providing core services such as memory management, thread management while also enforcing strict type safety and other forms of code accuracy.

8 CLR Execution Model

9 MSIL or IL (Platform Independence) Microsoft intermediate language(MSIL) or Intermediate language(IL) is independent of programming language, targeting machine and OS Process of Traditional compiler Source code Machine code Platform dependent Compiler targeting.Net Source code MSIL Machine Code Platform independent Compiled Execute

10 MSIL or IL (Platform Independence) The MSIL code includes the instructions to load, initialize and invoke methods on Objects It also includes the instructions for various operations on programs code such as arithmetic and logical operations, control flow, exception handling

11 Comparison to Java Hello.javaHello.classJVM compileexecute Source codeByte code Hello.vbHello.exeCLR compileexecute CIL Source code

12 Base Class Library(BCL) Also referred as Framework Class Library(FCL) It is library of classes available to all languages using.NET framework It provides classes, which encapsulate a no. of common function, including file reading & writing, graphic rendering, DB interaction & XML document manipulation.

13 ADO.NET It is a set of computer software components It is use to access data and data services It is a part of BCL Consists of 2 parts :- Data Provider – Connection, Parameter, Data Adapter, Data Reader Dataset

14 Web Services Web Services provide data and services to other applications. Web services are small units of code Benefits of Web Services Easier to communicate between applications Easier to reuse existing services Easier to distribute information to more consumers Rapid development

15 Common Language Specification (CLS) CLS is the collection of the rules and constraints that every language (that seeks to achieve.NET compatibility) must follow. CLS is nothing but guidelines that language to follow so that it can communicate with other.NET languages in a seamless manner It is a subset of the CTS

16 Common Language Specification (CLS) Microsoft defined 3 levels of CLS :- Compliant Provider Consumer Extender

17 CLR Important component of.Net Framework Supervise the execution of a.Net Program by providing various properties and controls in the areas of memory management, security, exception handling The CLR manages the execution of the code therefore the code that works on the CLR is called the managed code.

18 Architecture of CLR Base Class Library Support Thread Support Type CheckerException Manager SecurityDebug Engine JIT CompilerCode ManagerGarbage Collector Class Loader

19 Architecture of CLR Cont… Class loader: Manage and loading layout of class JIT compiler: Converts MSIL to native code Code manager: Manages code execution Garbage Collector: Handle automatic Memory management Security engine: It provides security based on policies and permissions that allow execution of mistrusted code to run in secure environment so they do not cause any problems. It will grant full access to trusted code.

20 Architecture of CLR Cont… Debug Engine: Allow to debug an application and trace the execution of code Type Checker: Type checker will verify types used in the application with CTS or CLS standards supported by CLR Exception Manager: Handles Errors at runtime using try.. catch..finally blocks. Thread Support: Enable multi-threaded programming

21 Architecture of CLR Cont… The CLR is composed of 5 primary parts: Common Type System(CTS) Common Language Specification(CLS) Common Intermediate Language(CIL) Just-In-Time Compiler(JIT) Virtual Execution System(VES)

22 The Common Type System (CTS) is a standard that specifies how Type definitions and specific values of Types are represented in computer memory. It is intended to allow programs written in different programming languages to easily share information For example, an integer variable in C# is written as int, whereas in Visual Basic it is written as integer. Therefore in.Net Framework you have single class called System.Int32 to interpret these variables Common Type System(CTS)

23 It defines how to declare, use and manage type in CLR and support cross language integration (code written in one language can interact with the code written in another language that provides Language independence) Types classified into two categories Value Type Reference Type

24 Common Intermediate Language(CIL) CIL is a CPU- and platform- independent instruction set It is low-level(machine) language, like Assembler, but is object-oriented CIL code is verified for safety during runtime Provides better security and reliability When the code is executed, the platform-specific VES will compile the CIL to the machine language according to the specific hardware CIL is passed through the Common Language Runtime’s JIT compiler to generate native code The native code is executed by the computer’s processor

25 Just-In Time(JIT) Compiler Convert the IL into machine code JIT compilation provides runtime type-safety & assembly verification To accomplish this, the JIT compiler examines the assembly metadata Offers better performance than interpreters as the compiled code is stored in memory cache at runtime Subsequent recompilation or reinterpretation of compiled code can be skipped Also giving flexibility to automatically recompile & optimize code that is found at runtime to be frequently executed

26 Virtual Execution System(VES) The VES provides an environment for executing managed code It provides the support required to execute the Common Intermediate Language Instruction Set

27 Managed Code Code running under control of CLR means code that is executed by CLR Represents programming code in the low level language MSIL The binary code is stored in a portable executable (PE) file It is created during compilation of the Program It contains definition of each type, signatures of data members in code, detail information about members in a code Allows integration between components and data types of different programming languages.

28 Managed Code Managed code is computer program code that executes under the management of a virtual machine, unlike unmanaged code, which is executed directly by the computer's CPU. The benefits of managed code include programmer convenience and enhanced security guarantees. Managed code is designed to be more reliable and robust than unmanaged code, examples are Garbage Collection, Type Safety etc

29 Benefits of.Net Framework Consistent Programming Model Provides Object Oriented programming model to create programs for performing different tasks Cross-Platform Support Any Windows platform that supports CLR can execute.Net Application Language Interoperability Enables code written in different languages to interact with each other

30 Benefits of.Net Framework Automatic Management of resources Do not need to manually free the application resources, such as files, memory, network and Database connection Ease of Deployment

31 What is Namespace Namespace Logically group types, example System.Web.UI logically groups our UI related features. Namespace can span multiple assembly. The thousands of classes defined in the.NET Framework are grouped in namespaces For example the System namespace that gathers the basic type classes, such as Integer, String and Array

32 Namespace Basics Namespaces are implemented in.NET assemblies. The System namespace is implemented in an assembly called System.dll provided. By referencing this assembly, the project gains the ability to reference all of the child namespaces of System that happen to be implemented in this assembly Project can import System.Text namespace because its implementation is in the System.dll assembly Project cannot import or use the System.Data namespace unless it references the assembly that implements this child of the System namespace, System.Data.dll

33 Exploring Namespace

34 System.Window.Form: The classes to create Windows Forms in Windows Application projects.This namespace contains the form elements has several class(Button class, Label class etc) that implements control on the toolbox System.Threading—This namespace contains the objects to work with and manipulate threads within your application System.Text—This commonly used namespace allows you to work with text in a number of different ways, usually in regard to string manipulation. One of the more popular objects that this namespace offers is the StringBuilder object

35 Exploring Namespace System.Web:This namespace provides the objects that deal with browser-server communications. Two of the main objects include the HttpRequest object, which deals with the request from the client to the server, and the HttpResponse object, which deals with the response from the server to the client. In VB.Net Namespace can be included in the form using “imports” statement. Imports System.Windows.Forms

36 Some.Net Base Class Library System System.DataSystem.Xml System.Web Globalization Diagnostics Configuration Collections Resources Reflection Net IO Threading Text ServiceProcess Security Design ADO SQLTypes SQL XPath XSLT Runtime InteropServices Remoting Serialization ConfigurationSessionState CachingSecurity Services Description Discovery Protocols UI HtmlControls WebControls System.Drawing Imaging Drawing2D Text Printing System.WinForms DesignComponentModel

37 Microsoft.VisualBasic Namespace This namespace gives access to all those functions that are available in VB6 These functions have been implemented in the.NET Framework, there is absolutely no performance hit This namespace is available for use by all of the.NET languages This means that even a C# developer could also use the Microsoft.VisualBasic namespace if he or she so desired

38 Microsoft.VisualBasic Namespace Microsoft.VisualBasic.Compatibility.VB6: Allows to include classes related to Visual Basic 6 environment Microsoft.VisualBasic.Compatibility.Data

39 Advantage of Namespace To avoid conflicts when you have multiple classes with the same name. For example,.NET comes with a class called 'Form'. Suppose you also write another class called 'Form' in your application and if you refer to the class 'Form', how does the compiler know which Form you are referring to ?

40 Garbage Collection The.Net Framework provides a new mechanism for releasing unreferenced objects from the memory (that is we no longer needed that objects in the program),this process is called Garbage Collection. It is one of the services of the CLR that prevents memory leaks during execution of program Garbage collector (Separate Thread) perform the operation We can call Garbage Collector (GC) explicitly in the program by calling System.GC.Collect

41 Versioning Each assembly has a version number as part of its identity and stored in assembly manifest Two assemblies that differ by version number are considered by the runtime to be completely different assemblies Physically represented as a four-part string... Ex: version 1.5.12.0

42 Versioning Problem Application build in.Net Framework 1.0 version can run on version 1.1 and application build on version 1.1 can run on version 2.0 However Application build on version 1.1 do not work with version 1.0 and similarly application build on version 2.0 do not work with version 1.1 Its called the versioning problem To overcome this problem side-by-side execution has been introduced

43 Side-by-Side Execution Ability to install and run multiple versions of the same component on the machine concurrently at the same time without interfering with each other You can have multiple versions of the common language runtime, and multiple versions of applications and components that use a version of the runtime, on the same computer at the same time

44 DLL Hell Problem Problem caused when multiple applications attempt to share a common component like a dynamic link library (DLL) What happen when Application1 will install a new version says 1.1.0.0 of Addition.dll? Application1 Application2 Addition.dll version 1.0.0.0

45 DLL Hell Problem Cont… Addition.dll with version 1.1.0.0 is not backward compatible with the version 1.0.0.0 already on the machine Although the application that has just been installed(Application1) works well, existing applications (Application2) that depended on a previous version of the DLL (version 1.0.0.0) might no longer work (stop working) Components require registration in the system registry

46 Address DLL Hell Problem Private DLLs are used by one particular application only and are not shared among different applications If an application relies on a specific version of a.dll file, then it can be installed in the application directory and a.local file created in the directory to inform that OS to look for private DLLs first and then move on to look for shared DLLs..NET components do not require any kind of registration in system registry

47 No Registration in.Net Assemblies in.NET are self-describing. All the information needed to execute an assembly is normally contained in the assembly itself Thus, there is no need to place any information in the Windows registry It will be easy to take a.Net component on server and copy to another server, It means you can copy applications instead of reinstalling them and the whole process becomes much simpler

48 COM InterOp COM is a language-neutral way of implementing objects that can be used in environments different from the one in which they were created COM (Binary interface) allows reuse of objects with no knowledge of their internal implementation COM Interop is a technology included in the.Net CLR that enables COM objects to interact with.NET objects, and vice versa COM Interop aims to provide access to the existing COM components without requiring that the original component be modified


Download ppt "History of.Net Introduced by Microsoft Earlier technology was VC++ and VB VC++ comes with so many library and VB was so easy to use and not flexible to."

Similar presentations


Ads by Google