I-Unit MCA-402 .Net Framework and Programming in ASP
I-Unit MCA-402 .Net Framework and Programming in ASP
Sanjay Tejasvee(9251933560)
Unit-I
Overview to .NET Framework Is a part / sub platform of .NET platform designed for
can adopt standards
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.
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.
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
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.
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.
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
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.
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
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.
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.
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:
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.
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
1. 2.
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.
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
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