Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CHAPTER I.NET FRAMEWORK AND VB.NET. 2 VB.NET INTRODUCTIONINTRODUCTION EVOLUTION OF THE.NET FRAMEWORKEVOLUTION OF THE.NET FRAMEWORK OVERVIEW OF THE.NET.

Similar presentations


Presentation on theme: "1 CHAPTER I.NET FRAMEWORK AND VB.NET. 2 VB.NET INTRODUCTIONINTRODUCTION EVOLUTION OF THE.NET FRAMEWORKEVOLUTION OF THE.NET FRAMEWORK OVERVIEW OF THE.NET."— Presentation transcript:

1 1 CHAPTER I.NET FRAMEWORK AND VB.NET

2 2 VB.NET INTRODUCTIONINTRODUCTION EVOLUTION OF THE.NET FRAMEWORKEVOLUTION OF THE.NET FRAMEWORK OVERVIEW OF THE.NET FRAMEWORKOVERVIEW OF THE.NET FRAMEWORK DLL, COM, COM+, DCOM AND ASSEMBLIESDLL, COM, COM+, DCOM AND ASSEMBLIES VB.NET LANGUAGEVB.NET LANGUAGE DEVELOPMENT OF A SIMPLE VB.NET PROGRAMDEVELOPMENT OF A SIMPLE VB.NET PROGRAM

3 3.NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a library for writing and executing written programs in any compliant language) The.NET framework comes with programming languages including VB.NET, C#, J#, and managed C++. Introduction to.NET Framework

4 4 What Is.NET.Net is a new framework for developing web- based and windows-based applications within the Microsoft environment. The framework offers a fundamental shift in Microsoft strategy: it moves application development from client-centric to server-centric..Net gives a common class library, which can be utilized by any of the given set of languages. The syntax of each.Net language can be explored by the class library

5 5 EVOLUTION VB.Net is developed by Microsoft It is Visual Basic for.Net Platform Ancestor of VB.Net is BASIC In 1991, Microsoft added visual components to BASIC and created Visual Basic After the development of.Net, VB was added with more set of controls and components and thus evolved a new language VB.Net

6 6 History Development began in 1998 Beta 1 released Oct, 2000 Beta 2 released July, 2001 Finalized in Dec, shipping in Feb 2002 Vista ships with.NET Framework 3.0 (Runtime) VB 6.0, VB 7.0 (VB.NET), VB 8,……

7 7.NET Sits on top on the OS Provides language interoperability across platforms Strong emphasis on Web connectivity, using XML web services to connect and share data between smart client devices, servers, and developers/users Platform/language independent.Net has the single class library, through which the code written in VB.Net / C# / J#.. Can be complied and executed. With class library the datatype compatibility can be achieved, by the powerful set of library classes

8 8 Purpose of.NET Framework Code written in any.net language( VB.Net / C#, J#, etc.) Converted in an Intermediate language (MSIL) MSIL code contains compiled code (cannot be executable) Operating System + Hardware.NET Framework.NET Application.Net application runs the.Net framework to execute the code..Net framework converts the execution to class libraries into relevant API There is no native code. But to execute MSIL, the.net framework converts the MSIL code into the native code ie. The.net Framework for windows will converts it into windows native code and execute, similarly for Linux also. MS is moving all its technologies to be.Net based or.Net related. SQL server may also support writing stored procedures in.Net languages. And.Net runtime environment will be the part of all OS in the future.

9 9 Pros and Cons Pros –Faster development of programs –Rich set of controls –Object Orientation of language enhances modularity, readability and maintainability Cons –Debugging larger programs is difficult, due to the absence of an effective debugger

10 10.NET Overview Three main elements: –The Framework (CLR, FCL / BCL, ASP, WinForms) –The Products (Windows, Visual Studio, Office) –The Services (My Services) Framework Goals –Improved reliability and integrated security. –Simplified development and deployment. –Unified API, multi-language support. XML is the.NET “Meta-Language”. All MS server products now.NET-enabled.

11 11 Base Class Library Common Language Specification Common Language Runtime ADO.NET: Data and XML VB.NETVC++VC# Visual Studio.NET ASP.NET: Web Services and Web Forms JScriptPerl… Windows Forms / User Interface Framework, Languages, And Tools

12 12.NET Framework Framework Class Library ADO.NET Network XML Security Threading Diagnostics IO Etc. Common Language Runtime Memory Management Common Type SystemLifecycle Monitoring C# VB.NET C++.NET Other Operating System VisualStudio.NETVisualStudio.NET Common Language Specification Windows Forms ASP.NETASP.NET Web Services ASP.NET Application Services Web FormsControlsDrawing Windows Application Services

13 13 The.NET Framework.NET Framework Services Common Language Runtime Windows ® Forms ASP.NET –Web Forms –Web Services ADO.NET, evolution of ADO Visual Studio.NET

14 14 Common Language Runtime (CLR) CLR works like a virtual machine in executing all languages. All.NET languages must obey the rules and standards imposed by CLR. Examples: –Object declaration, creation and use –Data types,language libraries –Error and exception handling –Interactive Development Environment (IDE)

15 15 Common Language Runtime Development –Mixed language applications Common Language Specification (CLS) Common Type System (CTS) Standard class framework Automatic memory management –Consistent error handling and safer execution –Potentially multi-platform Deployment –Removal of registration dependency –Safety – fewer versioning problems

16 16 Common Language Specification CLS is a set of rules that specifies features that all languages should support –Goal: have the.NET framework support multiple languages –CLS is an agreement among language designers and class library designers about the features and usage conventions that can be relied upon Example: public names should not rely on case for uniqueness since some languages are not case sensitive This does not mean all languages are not case sensitive above the CLR!

17 17 Some.NET Languages C# COBOL Eiffel Fortran Mercury Pascal Python SML Perl Smalltalk VB.NET VC++.NET J#.NET Scheme …. More are planned or under development

18 18 Compilation in.NET Code in VB.NETCode in C# Code in another.NET Language VB.NET compilerC# compiler Appropriate Compiler IL(Intermediate Language) code CLR just-in-time execution

19 19 Intermediate Language (IL).NET languages are not compiled to machine code. They are compiled to an Intermediate Language (IL). CLR accepts the IL code and recompiles it to machine code. The recompilation is just-in-time (JIT) meaning it is done as soon as a function or subroutine is called. The JIT code stays in memory for subsequent calls. In cases where there is not enough memory it is discarded thus making JIT process interpretive.

20 20 DLL, COM, COM+ A dynamic-link library (DLL) file is an executable file that allows programs to share code and other resources necessary to perform particular tasks. Microsoft Windows provides DLL files that contain functions and resources that allow Windows-based programs to operate in the Windows environment. Component Object Model (COM) is a binary-interface standard for software components introduced by Microsoft in 1993. It is used to enable interprocess communication and dynamic object creation in a large range of programming languages. COM is the basis for several other Microsoft technologies and frameworks, including OLE, OLE Automation, COM+, DCOM, the Windows shell, DirectX, and Windows Runtime. With Windows 2000, that significant extension to COM was incorporated into the operating system (as opposed to the series of external tools provided by MTS) and renamed COM+. At the same time, Microsoft de-emphasized DCOM as a separate entity. Components that made use of COM+ services were handled more directly by the added layer of COM+, in particular by operating system support for interception. In the first release of MTS, interception was tacked on - installing an MTS component would modify the Windows Registry to call the MTS software, and not the component directly.

21 21 ASSEMBLIES An assembly in the Common Language Infrastructure (CLI) is a compiled code library used for deployment, versioning, and security. There are two types: process assemblies (EXE) and library assemblies (DLL). A process assembly represents a process that will use classes defined in library assemblies. CLI assemblies contain code in CIL, which is usually generated from a CLI language, and then compiled into machine language at run time by the just-in- time compiler. In the.NET framework implementation, this compiler is part of the Common Language Runtime (CLR). An assembly can consist of one or more files. Code files are called modules. An assembly can contain more than one code module and since it is possible to use different languages to create code modules it is technically possible to use several different languages to create an assembly. Visual Studio however does not support using different languages in one assembly.

22 22 Multiple Languages Common Type System makes interoperability seamless between languages Class in one language can inherit from a class in another language Exceptions can be thrown across languages Makes it easier to learn a new.NET language since the same tools and classes are in place Can debug across languages

23 23 The Common Type System At the core of the Framework is a universal type system called the.NET Common Type System (CTS). Everything is an object - but efficient –Boxing and Unboxing All types fall into two categories - Value types and Reference types. –Value types contain actual data (cannot be null). Stored on the stack. Always initialized. –Three kinds of value types: Primitives, structures, and enumerations. Language compilers map keywords to the primitive types. For example, a C# “int” is mapped to System.Int32.

24 24 The Common Type System Reference types are type-safe object pointers. Allocated in the “managed heap” Four kinds of reference types: Classes, arrays, delegates, and interfaces. –When instances of value types go out of scope, they are instantly destroyed and memory is reclaimed. –When instances of reference types go out of scope, they are garbage collected. Boxing = converting an instance of a value type to a reference type. Usually done implicitly through parameter passing or variable assignments. UnBoxing = casting a reference type back into a value type variable.

25 25 The Common Type System Primitive Types Int16 Int32 Int64 Single Double Decimal Boolean Byte Char Currency DateTime TimeSpan Object Array String Enum ValueType Exception Delegate Multicast Delegate Multicast Delegate Class1 Class2 Class3

26 26 CTS & CLS Multiple Language Support CTS is a rich type system built into the CLR –Implements various types (int, double, etc) –And operations on those types CLS is a set of specifications that language and library designers need to follow –This will ensure interoperability between languages

27 27 MSIL and JIT Compilation Source code is compiled into MSIL (Microsoft Intermediate Language). Similar to Java bytecodes - CPU-independent instructions MSIL allows for runtime type-safety and security, as well as portable execution platforms. The MSIL architecture results in apps that run in one address space - thus much less OS overhead. Compilers also produce “metadata” or glue that binds the code with debuggers, browsers, etc. –Definitions of each type in your code. –Signatures of each type’s members. –Members that your code references. –Other runtime data for the CLR.

28 28 MSIL and JIT Compilation Metadata in the load file along with the MSIL enables code to be self-describing - no need for separate type libraries, IDL, or registry entries. When code is executed by the CLR, a JIT compilation step occurs. –Code is compiled method-by-method to native machine code as methods are invoked –Results in performance slowdown when a program is first executed, but can be efficient for code that is never executed –Subsequent invocations reuse compiled code, so no slowdown

29 29 Languages Languages provided by MS –VB, C++, C#, J#, JScript Third-parties are building –APL, COBOL, Pascal, Eiffel, Haskell, ML, Oberon, Perl, Python, Scheme, Smalltalk…

30 30 Windows Forms Framework for Building Rich Clients –RAD (Rapid Application Development) –Rich set of controls –Data aware –ActiveX ® Support –Licensing –Accessibility –Printing support –Unicode support –UI inheritance

31 31 ASP.NET ASP.NET,the platform services that allow to program Web Applications and Web Services in any.NET language ASP.NET Uses.NET languages to generate HTML pages. HTML page is targeted to the capabilities of the requesting Browser ASP.NET “Program” is compiled into a.NET class and cached the first time it is called. All subsequent calls use the cached version.

32 32 ASP.NET Logical Evolution of ASP –Supports multiple languages –Improved performance –Control-based, event-driven execution model –More productive –Cleanly encapsulated functionality

33 33 ASP.NET Web Forms Allows clean cut code –Code-behind Web Forms Easier for tools to generate Code within is compiled then executed Improved handling of state information Support for ASP.NET server controls –Data validation –Data bound grids

34 34 ASP.NET Web Services A technical definition –“A programmable application component accessible via standard Web protocols” Web Services It is just an application… …that exposes its features and capabilities over the network… …using XML… …to allow for the creation of powerful new applications that are more than the sum of their parts…

35 35 ADO.NET (Data and XML) New objects (e.g., DataSets) Separates connected / disconnected issues Language neutral data access Uses same types as CLR Great support for XML

36 36 Namespaces Namespaces are logical groupings of related classes. The namespaces in the.Net base class library are organized hierarchically. The root of class library is the System namespace. Other namespaces which are constituents of this root namespace, can be accessed with. (period) operator. Ex. System.Math, System. Data, System.Windows.Forms, System.IO, System.web.Services, System.Diagonositics, System.Net, System.Security, etc.

37 37 Visual Studio.NET Development tool that contains a rich set of productivity and debugging features

38 38.NET – Hierarchy, Another View CLR

39 39 Features of VB.Net Object Oriented Language Supports unified data type system. VB.NET code is managed by CLR. Release of unused objects taken care by the CLR Easy to develop. We can drag controls from the tool bar and drop them on the form and write code for the controls Runs on the CLR (Common Language Runtime) Many type-safe measures are incorporated. Classes are declared and defined in the same code blocks. VB.NET supports versioning features. VB.NET overcomes the DLL hell problems. Creating windows-based application is very easy Web forms in VB.NET enable to develop very efficient web- based applications which generates dynamic web content. Writing web services in VB. NET is very easy, because VB.NET was designed from the ground up with web services.

40 40 Summary The.NET Framework –Dramatically simplifies development and deployment –Provides robust and secure execution environment –Supports multiple programming languages


Download ppt "1 CHAPTER I.NET FRAMEWORK AND VB.NET. 2 VB.NET INTRODUCTIONINTRODUCTION EVOLUTION OF THE.NET FRAMEWORKEVOLUTION OF THE.NET FRAMEWORK OVERVIEW OF THE.NET."

Similar presentations


Ads by Google