Anda di halaman 1dari 11

Mr.

Sanjay Tejasvee(9251933560)

MIT 402: .Net Framework and Programming in ASP.Net

MCA-402 .Net Framework and Programming in ASP.Net


Introduction to .NET Framework : Genesis of .Net Features of .Net - .Net binaries Microsoft Intermediate Language Meta Data - .Net types and .net name spaces Common Language Runtime Common Type System Common Language Specification - .Net Applications using command line compiler and visual studio .net IDE.

Unit-I

Overview to .NET Framework Is a part / sub platform of .NET platform designed for
can adopt standards

writing Internet base applications that powerful application and extensive

such a XML, HTTP and SOAP.

Is a part / sub platform of .NET Platform to provide very rich and technologies, to build windows based as well as web based applications support for data access.

Is a part / sub platform of .NET Platform platform that has a base class library containing several classes, performing common tasks such as file manipulation, threading, security, registry access and searching text. Is a language neutral platform that means we can use any language in which we are comfortable.

Is a platform that provides great interoperability. Major Facts About .NET .NET, is a new Internet and web technology strategy by Microsoft. .NET should not be considered as a type of operating systems;
completely new internet and web based infrastructure.

it is a set of technologies that provides a

Software delivered by .NET is called as Web Services or Web Applications and most of the services provided by .NET are also called as Universal Services. .NET is completely based on new www standards and it runs on any browser independent of the platform.

Origins/Genesis of .NET Technology: o OLE Technology

o COM Technology o .NET Technology


OLE Technology
: OLE (Object Linking and Embedding) is Microsoft's component document technology. It allows us to link elements from different applications within each other. With OLE, We can dynamically link files and applications together. An object is a combination of data and the application needed to modify that data. We can embed objects in or link them to documents created with a different application. For instance, an Excel spreadsheet can be embedded within a Microsoft Word document using OLE. Double-clicking the embedded spreadsheet will launch Excel and allow the user to modify the sheet.

COM Technology
Microsoft COM (Common Object Model) technology in the Microsoft Windows-family of Operating Systems enables software components to communicate. COM is used by developers to create re-usable software components, link components together to build applications, and take advantage of Windows services. COM objects can be created with a variety of programming languages. Microsoft provides COM interfaces for many Windows application programming interfaces such as Direct Show, Media Foundation, Packaging API, Windows Animation Manager, Windows Portable Devices, and Microsoft Active Directory (AD). COM is used in applications such as the Microsoft Office Family of products. For example COM OLE technology allows Word documents to dynamically link to data in Excel spreadsheets and COM Automation allows users to build scripts in their applications to perform repetitive tasks or control one application from another

Mr. Sanjay Tejasvee(9251933560)

MIT 402: .Net Framework and Programming in ASP.Net

COM+ is the name of the COM-based services and technologies first released in Windows 2000. COM+ automatically handles programming tasks such as resource pooling, disconnected applications, event publication and subscription and distributed transactions.

.NET History & Information Many people are found confused about what exactly is .NET. Well, 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.

According to Steve Ballmer who quoted in January 2000, Delivering an Internet-based platform of Next Generation Windows Services is the top priority of our company. The breakthroughs were talking about here include changes to the programming model, to the user interface, to the application integration model, the file system, new XML schema.. Some people even considered Microsoft .Net as a new operating system; which is not the case. Microsoft .Net is net Web and Internet Strategy introduced by Microsoft. .Net introduces improved programming models and provide new and better Web based infrastructure. One of the key facts about .Net is that it delivers software as web services and the framework provided by Microsoft .Net is for universal services. Another important fact about .Net that you should always remember is that it can run on any browser and on any platform. Microsoft .Net is purely based on new web standards and is based on a new model; server centric computing model.

Overview of .NET

.Net is technology of collection or set of technologies to develop windows and web applications. .Net technology is developed by Microsoft and launched in feb.2002, by basic definition, Internet Strategy. a Microsofts new

It was originally called as NGWS (Next Generation Web Services). It is considered to be one of the most popular, powerful and useful Internet technology available today.

Mr. Sanjay Tejasvee(9251933560)

MIT 402: .Net Framework and Programming in ASP.Net

Today, the term used in replacement of NGWS is .NET because NGWS was originally used to describe Microsofts plans for developing Internet Based Platform for the next generation windows services. It included various changes in the programming models being used before the introduction of .NET and it brought many changes in the user interfaces, xml schemas, file systems and application integration models.

Mr. Sanjay Tejasvee(9251933560)

MIT 402: .Net Framework and Programming in ASP.Net

Mr. Sanjay Tejasvee(9251933560)

MIT 402: .Net Framework and Programming in ASP.Net

Features of .NET
1. Language Independence 2. Support the concept of Object Oriented Programming 3. Better Support for Dynamic web pages 4. Efficient Data Access 5. Code Sharing capabilities 6. Improved Security by User Authentication

Mr. Sanjay Tejasvee(9251933560)

MIT 402: .Net Framework and Programming in ASP.Net

8.

7. Support for web services High Scalability 9. Greatly increased performance by compile code 10. Easy Configuration and Easy Deployment 11. Compatibility and Interoperability.

Microsoft Intermediate Language-Meta Data


MSIL is a (IL) Intermediate Language, also Known as (CIL) Common Intermediate Language, or popularly the (MSIL) Microsoft Intermediate Language, is the Core of the .NET Framework. Microsoft Intermediate Language converts the source code into intermediate language and then machine code by JIT Compiler All .NET source codes written in any .net supportive language (C#, VB.net etc), when compiler are converted to MSIL. This MSIL at the Runtime, gets converted to machine code. The Runtime convention of MSIL code to the machine code is handled by a component called as the Just In Time (JIT) Compiler.

In other words, when we compile the code that uses the .NET framework library we dont immediately create operating system specific code, we compile our code into IL. This IL is not specific to any O/S and also is not specific to any language supported by the .NET languages e.g. VB.NET, C#, J#, VC++ etc. IL is also a language, which is converted into machine code JIT (just in time) compiler. IL is independent of the O/S machine.

Data about data is known as metadata, example, name, size, version of a file is metadata
about that file Information produced by an application to describe the properties. The metadata holds the interface definition of the classes, fields, methods and other program elements. The CLR uses metadata to load and run applications. .NET metadata, in the Microsoft .NET framework, refers to certain data structures embedded within the Common Intermediate Language code that describes the high-level structure of the code. Metadata describes all classes and class members that are defined in the assembly, and the classes and class members that the current assembly will call from another assembly. The metadata for a method contains the complete description of the method, including the class (and the assembly that contains the class), the return type and all of the method parameters. A .NET language compiler will generate the metadata and store this in the assembly containing the CIL. When the CLR executes CIL it will check to make sure that the metadata of the called method is the same as the metadata that is stored in the calling method. This ensures that a method can only be called with exactly the right number of parameters and exactly the right parameter types.

Type System
6

Mr. Sanjay Tejasvee(9251933560)

MIT 402: .Net Framework and Programming in ASP.Net

The common type system defines how types are declared, used, and managed in the runtime, and is also an important part of the runtime's support for cross-language integration. The common type system performs the following functions:

Establishes a framework that helps enable cross-language integration, type safety, and high performance code execution. Provides an object-oriented model that supports the complete implementation of many programming languages. Defines rules that languages must follow, which helps ensure that objects written in different languages can interact with each other.

Functions of the Common Type System



To establish a framework that helps enable cross-language integration, type safety, and high performance code execution . To provide an object-oriented model that supports the complete implementation of many programming languages. To define rules that languages must follow, which helps ensure that objects written in different languages can interact with each other. The CTS also defines the rules that ensures that the data types of objects written in various languages are able to interact with each other. The CTS also specifies the rules for type visibility and access to the members of a type, i.e. the CTS establishes the rules by which assemblies form scope for a type, and the Common Language Runtime enforces the visibility rules. The CTS defines the rules governing type inheritance, virtual methods and object lifetime. Languages supported by .NET can implement all or some common data types

Classification of Types
The common type system supports two general categories of types, each of which is further divided into subcategories:

Value types
Value types directly contain their data, and instances of value types are either allocated on the stack or allocated inline in a structure. Value types can be built-in (implemented by the runtime), user-defined, or enumerations. For a list of built-in value types.

Reference types Reference types store a reference to the value's memory address, and are allocated on the heap. Reference types can be self-describing types, pointer types, or interface types. The type of a reference type can be determined from values of self-describing types. Self-describing types are further split into arrays and class types. The class types are user-defined classes, boxed value types, and delegates.

Variables that are value types each have their own copy of the data, and therefore operations on one variable do not affect other variables. Variables that are reference types can refer to the same object; therefore, operations on one variable can affect the same object referred to by another variable. All types derive from the System.Object base type. The following example shows the difference between reference types and value types.

Imports System Class Class1 Public Value As Integer = 0

Mr. Sanjay Tejasvee(9251933560)

MIT 402: .Net Framework and Programming in ASP.Net

End Class 'Class1 Class Test Shared Sub Main() Dim val1 As Integer = 0 Dim val2 As Integer = val1 val2 = 123 Dim ref1 As New Class1() Dim ref2 As Class1 = ref1 ref2.Value = 123 Console.WriteLine("Values: {0}, {1}", val1, val2) Console.WriteLine("Refs: {0}, {1}", ref1.Value, ref2.Value) End Sub 'Main End Class 'Test [C#] using System; class Class1 { public int Value = 0; } class Test { static void Main() { int val1 = 0; int val2 = val1; val2 = 123; Class1 ref1 = new Class1(); Class1 ref2 = ref1; ref2.Value = 123; Console.WriteLine("Values: {0}, {1}", val1, val2); Console.WriteLine("Refs: {0}, {1}", ref1.Value, ref2.Value); } }
Output:

Values: 0, 123 Refs: 123, 123

Namespace
A namespace is a collection of different classes. All applications are developed using classes from the .NET System namespace. The namespace with all the built-in functionality is the System namespace. All other namespaces are based on this System namespace. From the viewpoint of the runtime, a namespace is just a collection of type names. Namespaces provides a way of organizing related classes and other types. Namespaces also reduce the conflict of use of same class name, because we can use fully qualified name instead of using namespace plus the class name both are same.

Some Namespaces and their use:


System: Includes essential classes and base classes for commonly used data types, events, exceptions and so on System.Collections: Includes classes and interfaces that define various collection of objects such as list, queues, hash tables, arrays, etc

Mr. Sanjay Tejasvee(9251933560)

MIT 402: .Net Framework and Programming in ASP.Net

System.Data: Includes classes which lets us handle data from data sources System.Data.OleDb: Includes classes that support the OLEDB .NET provider System.Data.SqlClient: Includes classes that support the SQL Server .NET provider System.Diagnostics: Includes classes that allow to debug our application and to step through our code System.Drawing: Provides access to drawing methods System.IO: Includes classes for data access with Files System.Net: Provides interface to protocols used on the internet System.Reflection: Includes classes and interfaces that return information about types, methods and fields System.Security: Includes classes to support the structure of common language runtime security system System.Threading: Includes classes and interfaces to support multithreaded applications System.Web: Includes classes and interfaces that support browser-server communication System.Web.Services: Includes classes that let us build and use Web Services System.Windows.Forms: Includes classes for creating Windows based forms System.XML: Includes classes for XML support

Common Language Runtime (CLR)


The .NET Framework is designed for cross-language compatibility. Cross-language compatibility means, for example an application written in Visual Basic .NET may reference a DLL file written in C# (C-Sharp). A Visual Basic .NET class might be derived from a C# class or vice versa. The .NET Framework consists of two main components as shown:

1. 2.

Common Language Runtime (CLR) Class Libraries

CLR is a runtime engine which compiles the code into MSIL, instead of compiling the code into native code. CLR is a runtime engine that manage .NET code which is written in any .NET language. CLR provides the environment within which the programs run. CLR manages the execution of programs and provides core services, such as code compilation, memory allocation, thread management, and garbage collection. CLR is the hear and soul of the .NET framework. In other words we can say, CLR is responsible for executing and managing all code written in by any .NET language that targets the .NET platform. Through the Common Type System (CTS), CLR enforces strict type safety, and it ensures that the code is executed in a safe environment by enforcing code access security. The software version of .NET is actually the CLR version.

Mr. Sanjay Tejasvee(9251933560)

MIT 402: .Net Framework and Programming in ASP.Net

Working of the CLR


When the .NET program is compiled, the output of the compiler is not an executable file but a file that contains a special type of code called the Microsoft Intermediate Language (MSIL), which is a low-level set of instructions understood by the common language run time. It's the job of the CLR to translate this Intermediate code into a executable code when the program is executed making the program to run in any environment for which the CLR is implemented. And that's how the .NET Framework achieves Portability. This MSIL is turned into executable code using a JIT (Just In Time) complier. The process goes like this, when .NET programs are executed, the CLR activates the JIT complier. The JIT complier converts MSIL into native code on a demand basis as each part of the program is needed. Thus the program executes as a native code even though it is compiled into MSIL making the program to run as fast as it would if it is compiled to native code but achieves the portability benefits of MSIL.

What is CLS ?
CLS stands for Common Language Specification (CLS) defines a set of rules that enables interpretability on the .NET Platform. These rules serve as a guide to third party compiler designers and library builders. The CLS is a subset of CTS and therefore the language supporting the CLS can use each other class libraries as if they are their own.

10

Mr. Sanjay Tejasvee(9251933560)

MIT 402: .Net Framework and Programming in ASP.Net

The Common Language Specification (CLS) is an agreement among language designers and class library designers to use a common subset of basic language features that all languages have to follow.

11

Anda mungkin juga menyukai