.NET FRAMEWORK By - idt.mdh.se · The .NET framework is a relatively new framework for programming...

21
.NET FRAMEWORK By Patrik Törnros Lisa Walterfeldt Mälardalen University Department of Computer Science and Engineering Object Oriented Programming, Continuation Course 5p 24th May 2004

Transcript of .NET FRAMEWORK By - idt.mdh.se · The .NET framework is a relatively new framework for programming...

.NET FRAMEWORKBy

Patrik Törnros Lisa Walterfeldt

Mälardalen UniversityDepartment of Computer Science and Engineering

Object Oriented Programming, Continuation Course 5p

24th May 2004

Abstract

Frameworks have become increasingly popular, through them reuse of designas well as code is achieved for object oriented systems. One relatively newframework is the .NET framework from Microsoft. The .NET framework is partof the larger .NET space. It includes the Common Language Runtime, a largenumber of partially interfaced, partially class-based frameworks packed intoassemblies, and a number of tools. .NET is an open platform for enterprise- andweb development and its is not bound to a particular programming language.

This paper starts with a description of the concept of frameworks. Next wetry to cover some of the pieces of .NET framework but due to the extensivesize of the .NET not all parts can be covered. The framework perspective of.NET is analysed and we try to focus on the Object Oriented aspects while stillcovering enough technical parts to let the reader learn about .NET features.We are not trying to paint the .NET features as unique and the only choice onthe market, nor do we try to compare .NET as a whole with its competitors.However we can conclude that the .NET framework has advantages over manyother frameworks we encountered in the past.

Contents1 INTRODUCTION 2

2 FRAMEWORK 3

3 .NET 53.1 .NET Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53.2 Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.2.1 Common Type System (CTS) . . . . . . . . . . . . . . . . 73.2.2 Common Language Specification (CLS) . . . . . . . . . . 8

3.3 Common Language Runtime (CLR) . . . . . . . . . . . . . . . . 83.4 Application domains . . . . . . . . . . . . . . . . . . . . . . . . . 9

3.4.1 Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.4.2 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.5 Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.6 Assemblies - the .NET software components . . . . . . . . . . . 113.7 Global Assembly Cache (GAC) . . . . . . . . . . . . . . . . . . . 12

3.7.1 Strong name . . . . . . . . . . . . . . . . . . . . . . . . . 123.8 Common Language Frameworks . . . . . . . . . . . . . . . . . . . 13

3.8.1 ADO.NET . . . . . . . . . . . . . . . . . . . . . . . . . . 133.8.2 Web Forms ASP.NET . . . . . . . . . . . . . . . . . . . . 133.8.3 Windows Forms . . . . . . . . . . . . . . . . . . . . . . . 14

3.9 Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4 ANALYSIS 164.1 Discussion of the framework perspective . . . . . . . . . . . . . . 164.2 Discussion of the Object-oriented perspective . . . . . . . . . . . 16

5 CONCLUSIONS 18

1 INTRODUCTIONThis is a paper written for the Object oriented programming continuation courseat Mälardalen University. The purpose of the course is to enlighten varioussubjects in the field of Object oriented programming. This paper will discussthe .NET framework from Microsoft.

Already in 1995 Gamma et al [Gamma95] predicted that frameworks wouldbecome increasingly popular. Through them the most reuse for object orientedsystems is achieved. Larger object oriented systems would consist of cooperat-ing layers of frameworks. Most of the code and design would come from theframework or be influenced by it.

The .NET framework is a relatively new framework for programming underthe Windows operating system.[Humphries02] The .NET framework is part ofthe larger .NET space. It includes the Common Language Runtime, a largenumber of partially interfaced, partially class-based frameworks packed into as-semblies, and a number of tools.[Humphries02, p 357] Since the .NET frameworkis a very large area we will not try to cover every detail of it in this paper. Wewill try to give an overview for a basic understanding and dig a bit deeper into afew important parts of the framework. Where appropriate we will try to discussthe framework from an object oriented perspective and make comparisons toother object oriented techniques such as Java and COM. We will also discussthe framework perspective of the .NET framework.

The intended readers of this paper are our co-students or other people withan interest in the .NET framework However, we presume our reader to have atleast basic knowledge in Object oriented programming techniques and no deeperknowledge of the .NET framework. The intention is to give the reader a basicunderstanding of the .NET framework from an object oriented perspective.

We start by giving an introduction to the framework concept. The chapter.NET starts with a brief overview of the .NET architecture to give a foundation,thereafter the parts and concepts of the .NET framework are explained in moredetail.

2 FRAMEWORKTo give an understanding of what the .NET framework is we will begin byinvestigating the framework concept.

Gamma et al [Gamma95] describes the framework concept as “. . . a set ofcooperating classes that make up a reusable design for a specific class of soft-ware . . . You customize a framework to a particular application by creatingapplication-specific subclasses of abstract classes from the framework”

According to Szyperski [Szyperski02, pp 158-159] frameworks are not neces-sarily domain specific, but they are usually concept specific. For example aframework for .NET Web Forms controls does not say much about the specificfunction of parts, but embodies the concepts that make a piece of software aweb form control.

According to Gamma et al [Gamma95] the framework will decide the archi-tecture of your application. It will set the overall structure like the divisioninto classes and objects, their main responsibilities and how they cooperate. Aframework defines all these design patterns so that the developer can concen-trate on the specifics of the application. Frameworks reuse designs that arecommon within specific application areas. They emphasize reuse of design overreuse of code. But usually a framework also contains concrete subclasses thatcan be used directly. With a framework the building of applications is faster.Applications will have a similar structure. They will be easier to maintain andwill appear more consistent to the users. On the other hand you loose somefreedom since a lot of the design decisions are made for you.

It is difficult to design a framework. The framework needs to fit all appli-cations in the area. Since a frameworks most important contribution to anapplication is the architecture it defines any major change in the design of aframework would reduce its advantages considerably. Therefore it is importantthat a framework is as flexible and extensible as possible. Since an application’sdesign is dependent on the framework applications are specifically sensitive tochanges in the interfaces of the framework. When a framework evolves applica-tions must evolve with it. This makes low coupling very important, otherwiseeven smaller changes will cause substantial repercussions.

Frameworks keep a number of their classes open for subclassing. Some maybe abstract requiring implementation to work. But some classes will offerdefault implementations to make them easier to use. Instead of defining ev-erything a client just needs to augment or replace those defaults that do notfit.[Szyperski02, p 159]

An important task of a framework is to regulate the interactions its partscan take part in. By freezing certain design decisions in the framework, criticalinteroperation aspects can be fixed. Through semifinished design a frameworkthus will speed up the creation of a specific solution. The degree of enforce-ment of the integration rules depends on the technology used. If the framework

consists of a set of Smalltalk classes, there is no strict enforcement that theprogrammer could not breach. If the framework is encapsulated into sealedmodules or packages of which the implementation is inaccessible enforcementcan be quite strict.[Szyperski02, pp 159-160]

3 .NETThe .NET platform is a development framework with a new interface towardsWindows services and APIs. .NET development helps the programmer to ig-nore the foundations and concentrate on solving business problem. It does thisby providing more and more built in functionality. .NET extends the trendof making programmers learn how to use more pre-written functionality whiledevelopers do not have to spend so much time writing code.[Conard00, p 31].NET aims to align a wide spectrum of MS products and services under a com-mon vision of interconnected devices of many kinds.[Szyperski02, p 358] At atechnical level .NET targets three levels:

• Web services

• Deployment platforms (servers and clients)

• Developer platforms

3.1 .NET Overview.NET is an open platform for enterprise- and web development. It is not boundto a particular programming language. The intent is to offer an abstract machinefor professional developers that covers traditional IT / client/server, multilayer- and web applications. [Meyer01] Figure 1 shows the overall structure of theplatform divided into six layers.

Frameworks and Libraries

ASP.NET, ADO.NET, Windows

Web Services

Interchange

standards

Common development

tools

Visual Studio .NET

Component Model

Common Language Runtime

Object Model and

Common Language Specification

Figure 1: The .NET architecture.

Web services

Web services offers web services for e-commerce business-to-business applica-tions.

Frameworks and libraries

A set of frameworks and libraries provide the most immediately useful featurefor developers. These include ASP.NET, ADO.NET and Windows Forms. Intotal .NET contains thousands of reusable components.

Interchange standards

XML based Interchange standards enable interchange of objects between differ-ent platforms.

Development Environment

The development environment, Visual Studio.NET, is a common developmentenvironment including facilities for development, compiling, browsing and de-bugging shared by many languages. Visual Studio.NET does not only supportMicrosoft languages (C#, C++ and VB) but also allows other vendors to plugin tools and compilers for other languages.

Component model

Before .NET there were three major models and standards for component-baseddevelopment: CORBA from the Object Management Group, J2EE from Sun,and Microsoft’s COM. .NET brings in one more model, based on object-orientedideas. With .NET you can build “assemblies”, each consisting of a number ofclasses. The model is quite different from COM, its major attractions are itssimplicity and the absence of an IDL (Interface Definition Language).

Object Model

The object model is the conceptual foundation on which everything else rests, inparticular, .NET’s OO type system. The common language specification definesrestrictions ensuring language operability.

Common Language Runtime (CLR)

The Common Language Runtime provides the basic set of mechanisms for exe-cuting .NET programs regardless of their original programming language. TheCommon Language Runtime handles translation to machine code, loading, se-curity mechanisms, memory management (including garbage collection), ver-sioning, and interfacing with non .NET code.

As a part of the .NET initiative Microsoft promotes language neutrality asa major principle of CLR and aims to establish a new language C#. C# ispositioned as the model language of the CLR, but as an equal beside severalother languages.[Szyperski02, p 329]

3.2 TypesLanguages and platforms have different strategies for handling types. The typeis necessary to decide how to interpret a binary sequence. Because of this cross-language and/or cross-platform interoperability is often problematic.[Barnaby02,

p 28] In the past there has been different approaches for handling these typeproblems.

The Java solution is simple. It just standardises for one platform (Java VirtualMachine) and one programming language (Java). The Java Virtual Machine hasin turn been ported to several operating systems. The disadvantage is that allcode has to be written in Java.[Barnaby02, p 28]

COM defines a binary standard that the programming languages must abideby. With COM communication is achieved through variant-compliant types (aleast-common-denominator). This makes it possible for components written indifferent languages to cooperate, though the platform should be Windows.[Barnaby02,p 28]

With .NET another approach for handling the type issue is introduced withthe Common Type System.

3.2.1 Common Type System (CTS)

At the centre of the .NET framework is an object model, called the VirtualObject System (VOS). At the centre of the object model is a type system. Theobject model relies on basic object oriented concepts, such as class, inheritance,dynamic binding, class-based typing and so on. The object model is an attemptto define a suitable base that bridges many programming languages. [Schult02]

The type system that .NET defines is called Common Type System (CTS).This type system is far more inclusive than the COM variant-compliant types,plus it defines how you can extend the types by creating your own custom types.A language that targets the .NET platform must map its types to those in theCTS. This makes all languages share this type system and they can cooperateseamlessly. This also makes it possible for a class from one language to inheritfrom another class in another language.[Barnaby02, pp 28-29]

The type system of .NET gives objects of predefined basic types, such asintegers and characters, a clear place in the type system. It also provides a wayto convert between reference and value types through “boxing” and “unboxing”operations. [Schult02]

int i=0;object box= i; //boxing C#int j=(int)box; // unboxing C#

The model is designed to be language-independent. It is possible for compilersfrom multiple languages (namely C#, C++, VB) to share a common back endin the .NET framework. Other Multilanguage component mechanisms such asCORBA and COM have one great disadvantage; it is necessary to write aninterface definition for every component to make it available for components inother languages. In .NET you just use classes from other languages as if theywere from your own. [Schult02]

3.2.2 Common Language Specification (CLS)

Programming languages differs in more ways than types. .NET limits the co-operational problems that these differences can cause by defining the CommonLanguage Specification. CLS specifies the minimum set of features that a lan-guage must support to target the .NET platform and the complete set of featuresit needs to support to be able to interoperate with other .NET languages. Thefeatures that the CLS defines are semantic. Keywords and syntax for differ-ent features can differ. Only types and parts of components that are exposedto other components need to abide by the CLS rules. The private parts of acomponent can use all the features of your .NET language of choice withoutconsideration of the CLS.[Barnaby02, p 29]

CTS and CLS play two complementary roles. CTS is the superset of manylanguages core concepts in the type area. However, no two languages cover theexact same subset of the CTS. For code implemented in different languagesto cooperate the CLS is important. CLS is a subset of CTS that is con-structed in such a way that many different programming languages can coverit completely.[Szyperski02, chapter 15.11.2] Figure 2 illustrates how CLS is asubset of CTS and how different programming languages can completely coverCLS while covering arbitrary parts of the CTS.

CTS

Language A Language BCLS

Figure 2: CLS is a subset of CTS

3.3 Common Language Runtime (CLR)Common Language Runtime is an execution engine and a full-featured classlibrary built to the specification of the Common Type System (CTS). CLR isresponsible for loading and running the application safely. It handles garbagecollection and security checks. Code that runs in CLR is called managed code.

The CLR class library provides hundreds of useful types that can be used asthey are or be extended through inheritance.[Barnaby02, p 30]

Developers will need to know the CLR. The CLR is what you will be pro-gramming directly against. Language- and tool vendors who wish to target the.NET platform need to understand the details of CTS and Common LanguageSpecification (CLS).[Barnaby02, p 30]

You can think of the runtime as an agent that manages the code at executiontime providing services like memory management, thread management, codeexecution, code safety verification and compilation. The runtime enforces stricttype and code-verification. The CTS ensures that all code is self-describing.Having the .NET compiler insert metadata that carry information about theresources needed like types, references and member variables. The runtimeuses metadata to find and load classes and to be able to (lay out) define spacefor instances. The CLR handles automatic memory management, like garbagecollection, this eliminates common errors like invalid memory references andmemory leaks.

To handle interoperability between programming languages, the .NET Frame-work types are CLS compliant and can therefore be used from any programminglanguage that targets the CLR and supports the CLS. Code written in different.NET languages can be combined.

CLR is an implementation of the Common Language Infrastructure (CLI)specification, adding COM+ interoperability and Windows platform access ser-vices. In particular CLR offers dynamic loading and unloading, garbage collec-tion, context interception, metadata reflection, remoting, persistence and otherruntime services that are fully language independent.[Szyperski02, p 357]

CLI defines a language neutral platform and an intermediate Language (IL)and deployment file format (assemblies). CLI also includes support for exten-sible metadata. The CLR is the implementation of the CLI specification. CLIcomprises the specification of execution engine services (such as loader, Just-In-Time (JIT) compiler and garbage-collection memory manager), the commontype system CTS and the common language specification.[Szyperski02, chapter15.11.2]

3.4 Application domainsUsually an operating system process is used to separate applications becausememory addresses are not shared between them. In .NET the primary applica-tion boundary is the AppDomain and not a process. CLR partitions a processinto one or more application domains (AppDomain). An AppDomain isolatesa set of objects from all objects in other AppDomains, but is more lightweightand thus cheaper than a process. Communications across AppDomain bound-aries requires marshalling (Communication through proxy objects that handlethe communication channel).[Barnaby02, p 92]

.NET managed code must be verified by the CLR. This means that the code istype safe and that the CLR can provide equal level of isolation as the operatingsystem process through application domains. This increases performance. Theapplication domains do not have to make cross-process calls or switch betweenprocesses. Additional benefits are that individual applications can be stopped orunloaded without stopping the entire process. The CLR uses threads to executecode. [msdn04]

3.4.1 Context

Finer execution space beyond AppDomains is provided by Contexts. An App-Domain can contain many contexts and must contain at least one called defaultcontext. A context provides an environment with a set of properties shared byall objects that exist in the context. It provides an interception boundary for theruntime to apply pre and post processing to all method calls from outside thecontext. The Context is a home for objects with similar runtime requirementssuch as synchronisation or just-in-time activation.[Barnaby02, p 96] Figure 3shows how a process can be divided into application domains, which in turnwill contain one or more contexts.

Process

AppDomain

Context 0

Context 1

Context n

AppDomain

Context 0

Context 1

Context n

AppDomain

Context 0

Context 1

Context n

Figure 3: The relationship between process, Application domains and Contexts

3.4.2 Attributes

CLR uses contextual composition [Szyperski02, p 330] and the context require-ment of an object is defined through attributes. These attributes are calledcontext attributes.[Barnaby02, p 96]

3.5 NamespacesIn order to manage naming conflicts .NET uses Namespaces. A Namespaceis a groping with related classes, interfaces and structures. One namespacecan hold other namespaces, this makes it possible for class libraries to havehierarchical structures. The “System” namespace is the root namespace in .NETclass framework. The .NET class framework has consistent design patterns andnaming conventions. For example all interfaces begin with I.[Conard00, pp 171-172]

Everything in .NET resides in some namespace. The line of code below showsthat the Collections namspace is located directly under the System namespacein the namespace hierarchy.

System.Collections namespace

Namespaces is a way to logically organise and categorise related types makingthem far easier to find and use. The types in a namespace can be accessed byusing the type’s fully qualified name. For example:

System.Console.WriteLine(“Hello world”);

However writing fully qualified names might get tiring and therefore many .NETlanguages provide a shortcut. In C# you use the “using directive”, which lets youaccess types without specifying the fully qualified name.[Barnaby02, pp 30-31]

using System;Console.WriteLine(“Hello world”);

3.6 Assemblies - the .NET software componentsAssemblies are the units of deployment, versioning and management in .NET.It is possible to have many assemblies with the same name but different ver-sion. Assemblies contain modules, metadata and resources. Code in assem-blies is expressed in Common Intermediate Language that resembles Java bytecode.[Szyperski02, p 357]

.NET assemblies can be described as binary components. These componentscan be used in other components or applications. This is done without accessto source code using the assemblies’ metadata.

An assembly is completely “self describing”. This is achieved through meta-data , (data about data). Metadata about each implemented type is con-tained within the assembly it self and metadata about the assembly is placedin the assembly’s Manifest. In the Mainfest metadata like version informa-tion, friendly name, culture information and dependencies on other assembliesis stored. Metadata is used to describe assemblies in enough detail for any user,runtime, tool or program to do component integration. Component integrationenables a .NET class to use and inherit from an assembly. Opposed to COMthat only supports component language independence (use of components in dif-ferent languages) .NET also supports language integration (inheritance, catchexceptions etc). [Thai01]

An assembly can be private or shared. A private assembly needs to be placedin the application directory. A shared assembly on the other hand needs to beplaced in the Global Assembly Cache.[Barnaby02, p 44]

3.7 Global Assembly Cache (GAC)An assembly often needs to be shared between many applications. A shared as-sembly needs to be installed in the Global Assembly Cache, which is a machine-wide Global cache. On Windows machines the GAC typically resides under theWindows installation in a directory called Assembly. The .NET runtime iden-tifies a shared assembly by a strong name, hence an assembly needs to have astrong name to be shared and installed in the GAC.[Barnaby02, p 44]

3.7.1 Strong name

A strong name is a combination of the friendly name (ex myProgram), cultureinformation, version number, a public key and a digital signature. All theseparts for the strong name need to exist in the manifest.[Barnaby02, pp 44-45]

For the key part of the strong name .NET uses asymmetric (or public key)cryptography techniques. This is used to guarantee that no one has tamperedwith the contents of the assembly since it was built or installed, no two pub-lishers can create assemblies with identical strong names and all versions of theassembly originate from the same publisher. Asymmetric cryptography involvesthe use of two keys (private and public key) that are mathematically related sothat only the public key can decrypt data encrypted by the private key. Whenyou build a shared assembly you supply the compiler with this key pair, thecompiler uses the private key to digitally sign and encrypt the assembly. Thiscreates the assembly’s digital signature. The assembly stores the key in itsmanifest and embeds the digital signature in a location accessible to the CLR.Now the assembly is ready to be installed in the GAC. At install time the GACuses the digital signature and public key to ensure that the assembly has notbeen altered since it was built. To make a client assembly that needs to use ashared assembly you set a reference to the shared assembly and then the com-piler will retrieve the public key from the shared assembly when the client isbuilt. The compiler hashes the public key from the referenced, shared assemblyinto an 8-byte public key token and stores this public key token in the clientsmanifest.[Barnaby02, pp 45-46]

At runtime when a client requests the types in a shared assembly the runtimeloads the assembly, reads its public key from the shared assembly’s manifest andgenerates a public key token. This public key token is then compared to thepublic key token stored in the client’s manifest. If they match we have verifiedthat the shared assembly originated from the publisher the client expected.After verifying the public key token the runtime uses the digital signature ofthe shared assembly to ensure that it has not been tampered with since it wasinstalled in the GAC.

3.8 Common Language FrameworksOn the top of CLR the .NET framework provides a large collection of frame-works. The nature of these frameworks varies somewhat in style. Some usesubclassing for customisation and others provide interfaces. In both cases frame-works make use of sealed classes to close the design in cases where the intricatenature of the implementation would make valid overriding very difficult. Theframeworks supported (in the first release) comprise about 70 assemblies andover 4000 public types (classes, interfaces, attributes, enums, delegates and valuetypes).[Szyperski02, p 368]

3.8.1 ADO.NET

.NET supplies a number of types (in an handful of namespaces) that allowyou to interact with local or remote data stores. These namespaces are knownunder the name ADO.NET. In a nutshell ADO.NET is a new database accesstechnology that specifically simplifies the development of disconnected systemsusing the .NET platform. ADO.NET uses a type called DataSet. This typegreatly extends the ADO disconnected recordset. DataSet represents a localcopy of any number of related tables. Another difference between ADO andADO.NET is that ADO.NET has full support for XML data representation.In fact, the data obtained from the data store is internally represented andtransmitted as XML. Perhaps the most fundamental difference between ADOand ADO.NET is that ADO.NET is a managed library and therefore plays byall the same rules as any managed library. The ADO.NET types are controlledand serviced by the CLR and are accessed in the exact same way regardless ofwhich .NET-aware language you use.[Barnaby02, pp 395-396]

3.8.2 Web Forms ASP.NET

ASP.NET’s Web controls provide a user interface comparable to non-Web GUIenvironments and far beyond what HTML offers as a default. [Meyer01]

Web Forms is a framework to build dialogs within ASP.NET. Web Formsworks by rendering to DHTML and relying on a browser to display and interactwith the user. ASP.NET aims to keep all application logic on the server andtarget any browser. It allows taking advantage of different browsers’ featuresautomatically.[Szyperski02, p 376]

ASP.NET separates presentation from application code. The presentationcode for the web form resides in a file with the extension “aspx” and is responsiblefor displaying the page including buttons, dropdown lists etc. The applicationcode, eg what will happen when the user pushes a button, resides in a “codebehind ” file.

ASP.NET accomplishes one of the most delicate aspects of Web request pro-cessing: “maintaining a client’s state”. HTTP is a stateless protocol, but anyrealistic Web interface-a shopping basket, for example-must retain client infor-mation from one page display to the next. ASP.NET maintains session statewithout storing client information on the server, thereby freeing developers from

using cumbersome manual techniques such as URL encoding, hidden fields, andcookies. It can achieve this both on a single server and across Web farms (mul-tiple servers that share the load). [Meyer01]

3.8.3 Windows Forms

Windows Forms is the .NET Framework family that enables the construction ofWindows applications. Windows Forms uses the Windows platform’s function-ality to render controls and interact with users. The basic model of WindowsForms (and Web Forms) is component classes.[Szyperski02, p 375]

Windows Forms uses a unified programming model. Windows Forms pro-vide a hierarchy of classes like MFC and other frameworks but it is language-independent. The architecture of Windows Forms is simple, it uses containersand controls. All Viewable components are controls. If a control contains othercontrols it is a container. The Control class is the base class of all user interfacecontrols; it provides common properties and behaviours. Because the WindowForms API is object orientated extending a control is as easy as inheriting fromit. Composite controls are controls that contain other controls and can inheritfrom the ContainerControl class but its subclass UserControl is a better startingpoint. The Application class has methods to use window messages.

3.9 Web ServicesWeb services offers web services for e-commerce business-to-business applica-tions. It is a framework for implementing distributed applications. With focuson when you do not have total control over both the client and server side, forexample when your application is interoperating with your business partnersapplications.

XML Web Services is a way of accessing software components through stan-dard Internet protocols. Web Services help software developers create buildingblocks of software. Web Services is a way of making “software as a service”the term service refers to what you get from a service provider. An example isbringing your dirty cloth to the cleaner to use its cleaning service. A softwareexample can be that you use an address book web service that stores your con-tact list and that you can use the mobile phone to get the names and numberswhen for example your phone is in for a repair. You then can collect the infor-mation from the web service to the borrowed phone while saving the phones infoto be able to restore the original information. Web services combine distributedcomponentization and the www.

XML is the key technology used in web services. It is used in web service wireformats, a technology for understanding how to exchange data between the webservice and the consumer, and it uses HTTP or SOAP (Simple Object AccessProtocol). SOAP is XML based and describes how to send messages betweenservice and client. The WSDL (Web Services Description Language) is used todescribe method calls and parameters. WSDL is done with XML. Web ServicesDiscovery is a process of looking up a service and checking out the servicedescription [Thai01]. Web services use asynchronous messages. [Conard00]

XML Web service components are not targeted for browsers but to be con-sumed by other applications. [msdn04]

.NET Framework provides a collection of classes that your code can derivefrom taking advantage of the underlying communication using SOAP and XMLform the base-class. The framework also includes tools for consumption ordevelopment of Web services. [Thai01]

Web Services enables a queriable web [Barnaby02]. A web service shares itsfunctionality through its methods. Compared to other techniques for distributedcomputing it is open for any technology that uses the XML (Extensible MarkupLanguage) regardless of platform. [Barnaby02]

4 ANALYSIS

4.1 Discussion of the framework perspectiveAccording to Gamma et al a framework will target a specific class of software.This however is hardly true for the .NET framework. .NET is designed to coveras many needs as possible and is not targeted for a specific class of software.This discrepancy can be explained by the fact that Gamma’s definition waspublished in 1995 and a lot has happened in the development of frameworkssince then. But maybe more important is to realise that the .NET frameworkin fact consists of several different frameworks that each have different targetsand functions. This large collection of frameworks makes it possible to make allsorts of different applications for different target areas.

A framework is a skeleton solution to a class of similar problems. This meansthat the .NET framework is a skeleton for building software applications. Theframework has a framework for developing web-applications, a framework forbuilding Windows-applications and much more.

It is clear that the .NET framework will influence the structure and archi-tecture of an application. We have seen one example of this in ASP.NET thatwill separate presentation from application logic with the “code behind” tech-nique. It is also clear that using all frameworks and libraries the building ofapplications is faster, since .NET takes care of a lot of low level programming.

4.2 Discussion of the Object-oriented perspectiveObject-oriented programming has over the last two decades evolved into thedominant programming paradigm.[Budd02, p 2] With the introduction of .NETmany older object-oriented programming languages have gotten a new opportu-nity to get in the game, the same applies to all languages that are targeting the.NET. The smaller languages can target the .NET platform and take advantageof its services, share the same compiler back-end and use the same libraries andframeworks. Hence it is not needed for the smaller languages to supply all thesefeatures them selfs, which for smaller languages might not be feasible.

One reason why OOP is popular is that it scales very well and it provides aform of abstraction that people use in their everyday lives.[Budd02, p 2] Theuse of a high level language does not make a programmer learn less; insteadit makes him do things in a more abstract manner, for example find smarterways to make calculations and increase performance. Even if these techniquescan be implemented in lower level languages, like assembler, most of the timethey will not. This is due to the fact that the programmer will be occupiedwith the details of registers and other low level tasks, taking the programmer’stime away from the specifics of the application.[Budd02, pp 3-4] OOP languagesabstract these things. The object-oriented frameworks never mention memoryaddresses.[Budd02, p 15] In the same way .NET abstracts much of the plumbingin developing.

The .NET approach for language neutrality is one of the great advantagesof .NET. The language neutrality makes it much easier to have componentswritten in different languages work together. Another great advantage is theservices of the CLR that runs a .NET application safely and among other thingshandle memory management and garbage collection.

5 CONCLUSIONS• The .NET is more than a framework. It is a large collection of frameworks

that makes it possible to make many different kinds of software for differenttarget areas.

• With the introduction of .NET many old object-oriented programminglanguages have gotten a new opportunity to get in the game, the sameapplies to all language that is targeting the .NET.

• .NET abstracts much of the pluming in developing applications letting thedeveloper concentrate on the specifics of the application.

• It is clear that the .NET framework will influence the structure and ar-chitecture of an application.

• Great advantages of the .NET framework are language neutrality, Theservices of the CLR and of course the extensive libraries and frameworksof .NET.

• Many of the sources that we have used for this paper focus on, and bringforward, the advantages of .NET. However, the disadvantages are muchharder to find anything written about in the early material (beta releaseetc). We do not say that the features of .NET are unique but there aremany of them, and they are well bundled.

References[msdn04] .NET Framework Developer’s Guide Overview of the .NET Frame-

work, msdn.Microsoft.com (2004-05-10)

[Barnaby02] Barnaby; Distributed .NET Programming in C#; Apress, NewYork 2002, ISBN 1-59059-039-2

[Conard00] James Conard, Patrick Dengler, Brian Francis, Jay Glynn, BurtonHarveym Billy Hollis, Rama Ramachandran, John Schenken, Scott Short,Chris Ullman , Introducing .NET ,Public Beta Release, Wrox Press, Birm-ingham, 2000, ISBN 1-861004-89-3

[Budd02] Timothy A. Budd, An Introduction to Object-Oriented Programming,Third Edition, Addison Wesley, Boston, 2002, ISBN 0-201-76031-2

[Gamma95] Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides, De-sign Patterns - Elements of Reusable Object-Oriented Software, AddisonWesley, Boston, 1995, ISBN 0-201-63361-2

[Humphries02] Jeffrey W. Humphries, Martin C. Carlisle and Terry A. Wilson;Multilanguage Programming with Ada in the .Net Environment ; Depart-ment of Computer Science usafa, USA

[Meyer01] Bertrand Meyer; .NET Is Coming ; Interactive Software Engineering,2001

[Schult02] Wolfgang Schult, Andreas Polze, Aspect-Oriented Programming withC# and .NET ; Hasso-Plattner-Institute at University Potsdam, Germany;IEEE Computer Society, 2002

[Szyperski02] Clemens Szyperski; Gruntz, Dominik; Murer, Stephan; Com-ponent Software, Beyond Object-Oriented Programming, Second Edition;Addison-Wesley, New York, 2002, ISBN 0-201-74572-0

[Thai01] Thuan Thai, Hoang Q Lam, .NET Framework Essentials, First Edi-tion, O’Reilly& Associates, Sebastopol, 2001, ISBN 0-596-00165-7