Vous êtes sur la page 1sur 10

HANDOUTS : 1

Visual Programming: UIIT

WHAT IS .NET Microsoft .NET (pronounced dot net) is a software component that runs on the Windows operating system. .NET provides tools and libraries that enable developers to create Windows software much faster and easier. .NET benefits end-users by providing applications of higher capability, quality and security. The .NET Framework must be installed on a users PC to run .NET applications. To best understand the concept lets compare .NET with windows operating system. In the first instance windows is a library; it is the set of all function calls in the Windows API which are available for you to use in program. These functions provide common features such as displaying dialog boxes, multiple document interface windows, accessing base functions such as security features or component services and so on. In the second instance windows is the environment in which your application runs, as well as the operating system itself. This is how Microsoft describes it: .NET is the Microsoft Web services strategy to connect information, people, systems, and devices through software. Integrated across the Microsoft platform, .NET technology provides the ability to quickly build, deploy, manage, and use connected, security-enhanced solutions with Web services. .NET-connected solutions enable businesses to integrate their systems more rapidly and in a more agile manner and help them realize the promise of information anytime, anywhere, on any device. .NET is composed of two things: First it is a library that is just as extensive as windows API. We can use it to call same sort features that have traditionally been part of windows operating system: displaying windows, dialog boxes and performing set of operations. Second, .NET provides the environment (the .NET Runtime) in which your program is run. When .NET aware application is run, it will be .NET that starts up your code, manages and running threads and provides various back-ground services.

HANDOUTS : 1

Visual Programming: UIIT

.NET environment sits as a layer between windows operating system and other applications, providing a much more up-to-date, object oriented and easy to use framework for developing and running code. Other applications which do not target .NET Framework, they can run directly by bypassing Framework execution environment.

.NET ARCHITECTURE: Microsoft .NET consists of four major components: Common Language Specification (CLS) Framework Class Library (FCL/a part is BCL-Base Class Library) Common Language Runtime (CLR) .NET Tools

HANDOUTS : 1

Visual Programming: UIIT

INTERMEDIATE LANGUAGE: All the code is compiled into intermediate language before execution. IL is object oriented and makes use of interfaces Strong distinction between value and reference types Strong data typing (Common Type System/CTS) Error handling through use of exceptions Compiler / interpreter based executable is mostly platform specific (like assembly), meaning that when you write a program using traditional development language and if it targets 16 bit architecture, it will not run on different architecture. Whereas IL (Intermediate Language) is platform independent and it is run by .NET Framework that takes care of host platform and converts IL code to native machine instructions at the run time when it loads the IL code for execution. BENEFITS OF .NET .NET provides the best platform available today for delivering Windows software. .NET helps to develop reliable and secure programs. .NET provides an integrated set of tools for building Web software and services and Windows desktop applications. .NET supports multiple programming languages and Service Oriented Architectures (SOA). .NET helps to develop programs that work on multiple devices including laptops, Smartphones and Pocket PCs. 1. Object-Oriented Programming 2. Good Design single base class library 3. Language Independence VB.NET, J#, C# and manages C++ 4. Better support for dynamic web-pages provides integrated support for web-pages. 5. Efficient Data Access ADO.NET 6. Code Sharing concept of assemblies replacing DLLs 7. Improved Security assemblies can contain security information, security levels about processes etc. 8. Zero Impact Installation by using private and shared assemblies (GAC) 9. Support for Web Services Fully support for developing web services

HANDOUTS : 1

Visual Programming: UIIT

10. Visual Studio supporting multi language development environment as well as ASP.NET C# - THE LANGUAGE C# is the language specifically designed for .NET. Some f the features of C# include: Full support for classes and object oriented programming, include both interface and implementation inheritance A consistent and well defined set of basic types Support for generating XML documentation automatically Automatic cleanup of dynamically allocated memory The facility to mark classes with user-defined attributes, use full for documentation and for compilation directives (e.g. methods marked for debug compilations Full access to the .NET base class library (BCL) and to Windows API (Application Programming Interface) Pointers and direct memory access is available if required (through unsafe code) but not recommended Support for properties and events Easily changeable compilation output, by switching between compiling to executable or library C# also fully supports writing ASP.NET dynamic web pages

C# CODE EXAMPLE public class Hello1 { public static void Main() { System.Console.WriteLine ("Hello,World!"); } }

HANDOUTS : 1

Visual Programming: UIIT

FRAMEWORK VERSIONS Version Name 1.0 1.0 SP1 1.0 SP2 1.0 SP3 1.1 1.1 SP1 2.0 3.0 3.5 4.0 Version Number 1.0.3705.0 1.0.3705.209 1.0.3705.288 1.0.3705.6018 1.1.4322.573 1.1.4322.2032 2.0.50727.42 3.0.4506.30 Release Date 2002-01-05 2002-03-19 2002-08-07 2004-08-31 2003-04-01 2004-08-30 2005-11-07 2006-11-06

HANDOUTS : 1

Visual Programming: UIIT

OBJECT RELATIONAL MAPPING Object-relational mapping (ORM, O/RM, O/R mapping) in computer software is a programming technique for converting data between incompatible type systems in objectoriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language. There are both free and commercial packages available that perform object-relational mapping, although some programmers opt to create their own ORM tools Object-relational mapping (ORM) is a mechanism that makes it possible to address, access and manipulate objects without having to consider how those objects relate to their data sources. ORM lets programmers maintain a consistent view of objects over time, even as the sources that deliver them, the sinks that receive them and the applications that access them change. ORM hides/encapsulates change in the data source itself, so that when data sources or their APIs change, only ORM needs to change to keep upnot the applications that use ORM to insulate themselves from this kind of effort. This capacity lets developers take advantage of new classes as they become available and also makes it easy to extend ORM-based applications. In many cases, ORM changes can incorporate new technology and capability without requiring changes to the code for related applications. HOW TO REFERENCE A LIBRARY IN C#: Some common library references in C#: Using System.IO; Using System.Data; Using System.Data.SqlClient; Using System.Text;

HANDOUTS : 1

Visual Programming: UIIT

When you compile a Microsoft.NET language, the complier generates code written in the Microsoft Intermediate Language (MSIL). MSIL is a set of instructions that can quickly be translated into native code.

JUST IN TIME (JIT) In computing, just-in-time compilation (JIT), also known as dynamic translation, is a method to improve the runtime performance of computer programs. Traditionally, computer programs had two modes of runtime operation, either interpreted or static (ahead-of-time) compilation. Interpreted code is translated from a high-level language to a machine code continuously during every execution, whereas statically compiled code is translated into machine code before execution, and only requires this translation once. Ahead-of-time (AOT) compiler is a compiler that implements ahead-of-time compilation. This refers to the act of compiling an intermediate language, such as Java bytecode, .NET Common Intermediate Language (CIL), or IBM System/38 or IBM System i "Technology Independent Machine Interface" code, into a system-dependent binary. JIT compilers represent a hybrid approach, with translation occurring continuously, as with interpreters, but with caching of translated code to minimize performance degradation. It also offers other advantages over statically compiled code at development time, such as handling of late-bound data types and the ability to enforce security guarantees. A Microsoft.NET application can be run only after the MSIL code is translated into native machine code. In .NET Framework, the intermediate language is complied "just in time" (JIT) into native code when the application or component is run instead of compiling the application at development time. The Microsoft.NET runtime consists of two JIT compilers, standard JIT compiler and the EconoJIT compiler. EconoJIT compiler compiles faster than the standard JIT compiler, but the code it produces is not as optimized as the code obtained from the standard JIT compiler.

HANDOUTS : 1

Visual Programming: UIIT

COMPILATION PROCESS IN DOT NET

HANDOUTS : 1

Visual Programming: UIIT

IL provides a number of primitive data types. One characteristic of intermediate language is however is that it makes a strong distinction between value and reference types.

Value Types: are those for which a variable directly stores its data. Normally stored on an area called stack. Reference Types: are those for which a variable simply stores the address at which the corresponding data can be found. Always stored on an area called managed heap.

MEMORY MANAGEMENT The Microsoft .NET common language runtime requires that all resources be allocated from the managed heap. Objects are automatically freed when they are no longer needed by the application. When a process is initialized, the runtime reserves a contiguous region of address space that initially has no storage allocated for it. This address space region is the managed heap. The heap also maintains a pointer. This pointer indicates where the next object is to be allocated within the heap. Initially, the pointer is set to the base address of the reserved address space region. An application creates an object using the new operator.
This operator first makes sure that the bytes required by the new object fit in the reserved region (committing storage if necessary). If the object fits, then pointer points to the object in the heap,

this object's constructor is called, and the new operator returns the address of the object. The stack is a place in the computer memory where all the variables that are declared and initialized before runtime are stored. The heap is the section of computer memory where all the variables created or initialized at runtime are stored. Why is stack and heap important? When a program is loaded into memory, it takes some memory management to organize the process. If memory management was not present in your computer memory, programs would clash with each other leaving the computer non-functional.

HANDOUTS : 1

Visual Programming: UIIT

The garbage collector checks to see if there are any objects in the heap that are no longer being used by the application. If such objects exist, then the memory used by these objects can be reclaimed. (If no more memory is available for the heap, then the new operator throws an OutOfMemoryException.) Every application has a set of roots. Roots identify storage locations, which refer to objects on the managed heap or to objects that are set to null. For example, all the global and static object pointers in an application are considered part of the application's roots.

LANGUAGE INTEROPERABILITY What we mean by language interoperability is that classes written in one language can directly talk to classes written in another language. In particular: 1. Class written in one language can inherit from a class written in another language 2. A class can contain an instance of another class, no matter what the languages of the two classes are. 3. An object can directly call methods of another object written in different language. 4. We can step through methods in debugger when calling between different languages constructs.

VISUAL PROGRAMMING UNIVERSITY INSTINUTE OF IT Faisal Fayyaz Kiyani

Vous aimerez peut-être aussi