Computerworld

.NET Executive Guide

.NET is Microsoft's vision for computing. Introduced with great fanfare more than two years ago, .NET promises to use common Internet protocols to seamlessly interconnect devices, data and applications. Heavily reliant on XML, .NET is designed to allow users to access applications and data wherever they may be on whatever device is most convenient.

What are Web services?

Before we go further, let us take a minute to talk about Web services. One of the most confusing things about Web services is the very term itself. The word 'services' conjures up visions of people paying for something and getting something back. But at the most basic level, Web services is just a new flavour of standards-based software technology that allows programmers to combine existing computer systems in new ways, over the Internet, within one business or across many.

Web services lets companies bridge communications gaps between software written in different programming languages, developed by different vendors or running on different operating systems. The technology is drawing such huge hype because it promises to make it easier for companies to integrate software and reuse software that they or others have already built, and building software is historically an expensive and time-consuming process.

The most important part of Web services is a technology called XML, or extensible markup language (more on XML follows). For Web services to work, both sides (companies in communication with each other over the Internet) need to be able to speak XML. Microsoft's Web services strategy is, surprise, surprise, called .NET.

What is .NET?

The idea for .NET dates to 1999, when it was talked about as Next Generation Windows Services. Before the arrival of .NET, the Microsoft acronym of choice was DNA, which stands for Distributed Internet Architecture.

.NET supplants DNA and elevates the Microsoft development environment and tools to a new level of sophistication, power and ease of use, compared with previous versions of Microsoft development tools.

According to Microsoft, ".NET is a set of Microsoft software technologies for connecting your world of information, people, systems, and devices". Unlike Windows, .NET won't ship as a stand-alone product on a specific date. Instead, the company is gradually incorporating the technology into a variety of new and existing products.

The truth is, .NET evades easy definition because it covers so many topics. Some define it as a development platform for building XML Web services, while others think it's a set of enterprise servers. Both lines of thinking prove correct, although neither tells the whole story. Here's a blueprint for the second-generation Web from a .NET perspective:

XML

XML (extensible markup language) is a common method for describing data, and lets programmers write their own tags to identify information in a document and put it into context. Industry groups are getting together to define their own XML dialects. For example, the shoe industry might agree on one tag to represent shoe size, another to represent shoe colour and so on.

.NET uses XML for universal representation, exchange and storage of all kinds of data -- and, in particular, to describe and manipulate component interfaces.

Components

Today, components come in many flavours: shared libraries, script language modules and application-specific plug-ins. Component models like Component Object Model (COM) and Common Object Request Broker Architecture (Corba) make code reuse among these flavours possible but not easy, so it often doesn't happen -- particularly across organisational boundaries. Yet imagine how useful it could be to, say, travel agents, if airlines provided a pre-compiled component that could look up flight vacancies, reserve airfares and so forth. .NET aims to make component construction and reuse so easy that there's no excuse not to do it.

Objects

In theory, objects created by object-oriented programming (OOP) languages are components. In practice, the languages' object models don't match cross-language component models like COM and Corba. The .NET Common Language Runtime, a universal OOP engine, aims to solve this problem.

Because all .NET languages share the same object model, an object written in any .NET language is automatically a component available to all others.

This has some amazing ramifications. Most importantly, all .NET languages now provide all the features of any other .NET languages. For the first time, Visual Basic.NET offers structured exception handling and true object-oriented facilities like inheritance and polymorphism - just like C++ programmers are used to.

Microsoft also created a brand new programming language called C# (pronounced c sharp) that it submitted to the European Computer Manufacturers Association (ECMA) for consideration as a standard.

Frameworks

Every programming language comes with standard libraries -0 called frameworks in the case of OOP languages -- that encapsulate common code and define patterns for using it. The Java Development Kit's class libraries and Delphi's Visual Component Library are such frameworks. The .NET framework covers similar ground, but in a language-neutral way. C#, Visual Basic.NET and other .NET languages are only lenses through which programmers see the same underlying framework.

The Common Language Runtime (CLR)

.NET introduces an important technology known as the Common Language Runtime, or CLR. This is the basic library of functions and methods that make up the .NET framework. In other words, for all the functionality offered by .NET, there are corresponding routines in the CLR that enable this functionality to be used.

You can think of the CLR as a 'virtual machine', similar to Java's virtual machine concept. The comparison is quite apt; just as a Java program compiles to a pseudo byte-code (rather than pure machine language, like a C++ program does) which can then be executed on any Java virtual machine on any computer, so too .NET programs compile to an intermediate language.

In .NET, this is called the Microsoft Intermediate Language -- or MSIL. All .NET languages target the CLR, and all .NET languages compile down to MSIL.

It is this MSIL intermediate code that executes in the .NET framework. Theoretically, this even means that .NET programs could run on non-Windows platforms if ever Microsoft develops an implementation of the CLR for another operating system -- such as Unix.

Glue

In every programming environment, there's a division of labour. A few people make the components that many others glue together. Components are often written in compiled languages such as C and C++. The glue is usually a scripting language, ideally one supported by an integrated development environment. The first-generation Web is bound together by glue languages: JavaScript, Perl, Python, PHP and several forms of Visual Basic. But it's also balkanised into glue-language communities. One .NET goal is to universalise the glue -- making components, plus the knowledge and the tools to use them effectively -- available to solution builders, whatever kind of glue they prefer.

Protocols

Simple and open protocols let the first-generation Web scale up beyond most people's wildest expectations. The Web protocol, HTTP, carrying an HTML payload, brought client/server applications to the masses. On the next-generation Web, HTTP will also carry various XML payloads. Most notable among these is Simple Object Access Protocol (SOAP), which enables n-tier applications (this is when you use a mix of computer hardware and/or software layers, in order to provide a modular collection of information services) made by interconnecting network services across programming-language and platform boundaries. The .NET technology works hard to make it easy for developers to make and use components with SOAP interfaces.

Middleware

In the n-tier environment, a network service has to juggle connections to users, data and other services. Windows NT and 2000 already supply basic middleware (Microsoft Transaction Server, or MTS, and COM+, respectively) for pooling and transactional control of these resources. The .NET platform doesn't invent new middleware. Instead, it aims to generalise and further simplify the use of existing COM+ technology.

Tools

Developers rely on tools that can capably build, debug and deploy software. Today, these tools are language-specific. But projects aren't. A first-generation Web service will probably involve several kinds of components and several flavours of glue. There are tools for building, debugging and deploying these various pieces, but there hasn't been one that comprehends the whole. That is what Microsoft hopes to achieve with Visual Studio.NET. Leveraging the universality of the .NET framework, runtime and languages, it gives developers a single interface through which to manage multilanguage, multicomponent projects.

An important technology here is the CLR. The CLR allows programs written in more than 20 languages to run on the .NET platform. With the CLR built into SQL Server for example, developers will be able to program for SQL Server using the same language and Visual Studio .NET tools they use to write their desktop- and server-based applications. Today, developers typically use the T-SQL language for Microsoft database programming, but with the Visual Studio for Yukon release (the forthcoming version of SQL Server), they will be able to use Visual Basic, C#, J#, C++ and other CLR-supported languages to write to databases.

The next-generation Web

These broad strokes paint a picture of software development for the next-generation Web. Some aspects have been known for a while. XML interfaces to Web services have been in use for several years. Many languages support XML and are now starting to support SOAP. Savvy Web developers are already using XML to isolate business logic from presentation and to offer interfaces to partner services.

Nobody needs to wait for .NET to do these things, and nobody should. Services built this way will interoperate now, no matter the platform or implementation language, and they will interoperate with .NET.

Who is .NET aimed at?

Today, what's of use in .NET is mostly aimed at Microsoft's legion of developers. These developers are relying on XML and the Simple Object Access Protocol (SOAP), which is a standard for sending messages across the Internet that activate programs or applications regardless of their underlying infrastructure. Also useful are Universal Description, Discovery and Integration (UDDI) -- a directory of companies and their XML interfaces -- and Web Services Description Language (WSDL), which describes what a piece of application code can do.

But today, to most companies .NET means using XML and SOAP to let diverse and even proprietary systems talk to one another and share data -- a goal that by no means defines just .NET. After all, Hewlett-Packard, IBM, Novell and Sun are among other vendors using the same standards for their own strategies similar to .NET.

Page Break

Features of .NET

Language support

.NET is language independent and can use any language once a mapping exists from that language to MSIL. At the time of this writing, several third-party vendors have produced language compilers that target the CLR; examples include NetCobol from Fujitsu, and Visual Perl and Visual Python from ActiveState,.

Because all .NET languages share a common type system, developers can safely pass types written in one language to code written in another (even Strings from Visual Basic.NET to Visual C++.NET!). They can also use the unified Framework class libraries in any .NET language, saving them from having to learn how to work with many different implementations.

Standards support

Microsoft has long been criticised for tightly controlling its technologies. However, the company took a huge step forward when it submitted C# and the CLR to ECMA for ratification. On December 13, 2001, the ECMA General Assembly ratified the C# and CLR specifications into international standards, allowing others to participate in their evolution.

Tools support

Microsoft's long and successful development tools history continues with Visual Studio .NET, the single Integrated Development Environment (IDE) for building .NET applications, whether you're building Windows applications, Web applications, or XML Web services. With Visual Studio .NET, you can choose any .NET language. From the developer's viewpoint, applications are built using a single IDE. Visual Studio .NET boasts too many features to address here, but it's worth mentioning the new Server Explorer feature. With the Server Explorer, developers can access server resources (message queues, performance counters, data sources, and so on) in a drag-and-drop fashion without ever leaving Visual Studio .NET. Microsoft likes to think of this as "RAD for the server".

How does it work?

In a .NET application, SOAP uses XML to describe messages and transports them via HTTP. Web Services Description Language (WDSL) is a new specification to describe networked XML-based services -- Web services.

WDSL offers a simple way to describe the basic format of requests regardless of the underlying protocol (such as SOAP or XML) or encoding (such as Multi-purpose Internet Mail Extensions). WDSL is a key part of the effort of the Universal Description, Discovery and Integration (UDDI) initiative to provide directories and descriptions of online services for e-commerce.

Visual Studio.NET makes creating Web service client or server applications intuitive and easy. To build a Web service server for example, you use a Visual Studio.NET wizard to create your initial application. To expose a class method in the Visual Basic application you created as a Web service, you add the attribute "<Webmethod()>" as part of the function definition.

Once the XML Web service has been built, it can be invoked via HTTP using XML to pass data to and from the service. To use an XML Web service from Visual Studio.NET, all developers need to do is add a Web reference to the exposed Web service.

Page Break

.NET vs J2EE

With the advent of .NET, Microsoft introduced an enterprise computing platform able to compete toe-to-toe with Sun Microsystems' J2EE (Java 2 Platform, Enterprise Edition). Much debate at the moment revolves around which language works better --.NET's C# or Java?

When thinking of the Java 2 Platform, Enterprise Edition, the key word is platform. Java represents more than just a programming language, as it encompasses the Java Virtual Machine (VM) technology that lets compiled Java programs run unaltered on various machine architectures; tools to compile, analyse, debug, and deploy Java programs; and other components, such as browser plug-ins, rich media, and more.

The three faces of Java:

-- The Java 2 Platform, Micro Edition (J2ME), for handheld and other lower-end devices
-- The Java 2 Platform, Standard Edition (J2SE), targeted at desktop machines
-- The Java 2 Platform, Enterprise Edition (J2EE), installed on servers and responsible for the heavy lifting in the Java world.

Although it's something of a simplification, you can think of J2ME as a subset of J2SE and J2EE as a superset of J2SE.

So what exactly is J2EE? J2EE is a Java-based technology stack, built on top of J2SE, that provides developers with the development tools and runtime capabilities necessary to build enterprise applications meeting rigorous uptime, security, scalability, and maintainability requirements.

On the other hand, Microsoft's .NET framework is based on its CLR, which is composed of a specification for Microsoft Intermediate Language code and a runtime environment that provides memory management (including automatic garbage collection), security and threading. Although this is analogous to the Java Virtual Machine architecture, the difference is that code targeted for the CLR can be written in any language that supports the CLR's component model (whereas only Java supports the Java Virtual Machine)

Visual Studio.NET comes with the Microsoft languages Visual Basic, Visual C++ and Visual C#. C# is an object-oriented language that is a fundamental piece in Microsoft's new .NET strategy. C# builds on the syntax and object-oriented features of C++ and adds functionality to make it more Web services friendly.

Although C# is similar to Java, it is also different. Both languages share many of the same benefits, such as being fully object-oriented, but the languages diverge on features such as operator overloading and enumerations.

The .NET development framework can therefore be subdivided into three parts:

-- A CLR run-time engine.
-- A set of extensive class libraries, written from the ground up, that comprise practically any functionality you could ask for.
-- Two top-level development "arenas" -- one for Web applications (ASP.NET, Active Server Pages) and another for regular Windows applications.

.NET servers

Microsoft has some 13 products in its .NET server line up. Such products include Commerce Server, Content Management Server, BizTalk Server, SQL Server and Windows .NET Server 2003.

Microsoft shipped Release Candidate 1, a near complete version of Windows .NET Server, in late July. Windows.NET Server 2003 is the successor to Windows 2000 Server operating system. It is Microsoft's first server operating system that will ship with native support for the .NET Framework. Windows .NET Server 2003 provides many services that a developer may use to create their loosely coupled applications, says Michael Leworthy, Windows server product manager. "Loosely coupled means that my application can utilise other Web services, and they do not have to be included in my code. I do not have to understand how they work or what system they run on, I can just send them data or requests, and expect certain information from them." This is the great advantage of XML Web services, he says.

Microsoft will ship Content Management Server 2002 by the year's end, adding new support for XML content management and Web services. This product manages content on the Internet and within intranets. One key addition to the software is its integration with Microsoft Word. Users will be able to author content in a Word document with text and graphics and publish that content directly to Content Management Server 2002. In such a case, users will have an option in the File menu in Word that brings up a wizard to help format and set parameters for publishing content to the Web.

.NET GLOSSARY


Smart client software: Software for running a variety of smart clients, from personal computers (Windows XP), to small-footprint devices like PDAs (Windows CE .NET), to set-top devices (Windows XP Embedded).

XML Web services: lets applications share data and consume services provided by other applications without regard to how those applications were built, what platform they run on, or what devices access them. .NET includes implementations of the latest accepted Web service standards, such as the XML Schema standard. In addition, Microsoft plans to provide many commercially available foundation services, called My Services, to serve as application building blocks. As a recent example, the MapPoint.NET Web service integrates maps and driving directions into applications. (That effort, however, has recently lost some momentum because partners have been slow to jump on board.)

Enterprise servers: products that support enterprise applications by addressing different parts of the overall solution. Among the offerings in the mix are Application Center for deploying and managing Web applications, BizTalk Server for coordinating XML-based business processes across applications and organisations, and the SQL Server database application.

Development tools and the runtime environment: includes Visual Studio .NET, a single integrated development environment for building .NET applications, along with the .NET Framework, which in turn includes, ASP.NET (a new Web development environment for building Web applications and XML Web services), an extensive set of framework class libraries and the Common Language Runtime (CLR).

The CLR basically enables a developer to extend their developmental power with the new classes and objects which are available within the .NET Framework, and develop Web services, just as easily, whether using C, Perl or Cobol.

Edited by Howard Dahdah and David Williams. Computerworld US, JavaWorld and InfoWorld reporters contributed to this guide.