Professional Documents
Culture Documents
Overview
Overview
NET Framework
Shabana Begum
.NET Framework
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 servercentric.
The .NET Framework is a key Microsoft offering, and is intended to be used by most new applications created for the Windows platform. It is a foundation to build and run .NET-based applications. The unified nature of the .NET Framework means that all applications, whether they are Console application, Windows applications, Web applications, or XML Web services, are developed by using a common set of tools and code, and are easily integrated with one another.
.NET Application
.NET Framework
CLR contd..
Deployment
Removal of registration dependency Safety fewer versioning problems
CLS is a set of specifications that language and library designers need to follow
This will ensure interoperability between languages
CTS CLS If language complies to CLS it can interoperate with other .NET languages
Compilation in .NET
Code in VB.NET Code in C# Code in another .NET Language
VB.NET compiler
C# compiler
Appropriate Compiler
Intermediate Language
Intermediate Language
Interpreter English
NAMESPACE
Namespace is a way to keep one set of names separate from another. It organizes code and gives a way to create globallyunique types. In C#, namespaces are used to logically arrange classes, structs, interfaces, enums and delegates. The namespaces in C# can be nested. That means one namespace can contain other namespaces also. User can define their own namespaces. A Namespace in Microsoft .Net is like containers of objects. They may contain unions, classes, structures, interfaces, enumerators and delegates
Goal of using namespace in .Net is for creating a hierarchical organization of program. In Microsoft .Net, every program is created with a default namespace named as global namespace. Program itself can declare any number of namespaces, each of them with a unique name. The advantage is that every namespace can contain any number of classes, functions, variables and also namespaces etc., whose names are unique only inside the namespace. The members with the same name can be created in some other namespace without any compiler complaints from Microsoft .Net.
Namespaces
(contd) contd)
Used to avoid naming conflicts A default namespace is created even if one is not created. Reduces complexity when code is to be re-used for some other application Declaring a Namespace Syntax Namespace Namespace name { //all classes for namespaces go here }
Class Library
The .NET Framework class library exposes features of the runtime and simplifies the development of .NET-based applications. In addition, developers can extend classes by creating their own libraries of classes. The .NET Framework class library implements the .NET Framework. All applications (Web, Windows, and XML Web services) access the same.NET Framework class libraries, which are held in namespaces. All .NETbased languages also access the same libraries.
Cont.
An assembly is a means of reusing code
Assembly Structure
contd.
Assembly Metadata- .NET metadata can be thought of simply as a collection of information existing in binary form inside a Portable Executable (PE) file or a .NET assembly Type Metadata-Type Metadata describes the data present in the assembly and its type. This metadata contains a declaration for every type and member(methods, fields, properties, and events).
contd.
MSIL Code -.NET compilers compile the source code into an Intermediate Language called MSIL (Microsoft Intermediate Language Resources-While developing applications, more than often one will make use of JPEG, text, XML and other types of files in an application. These miscellaneous picture and sound files are termed as resources
Types Of Assembly
There are two types of assembly a).Private assembly b).Public assembly. A private assembly deployed with application, and stored in the application's directory. It is used by only one application . A shared assembly is stored in the global assembly cache (GAC), maintained by the .NET runtime. It is shared among different application . One more type of assemblies called satellite assemblies are used for localization.(partition the resources based on a specific culture).