Chapter 2 Using Microsoft Technologies27 2.2 The Distributed Internet Applications Architecture 292.2.1 Windows DNA COM and DCOM Services 322.2.2 Windows DNA Transaction Services 342.2.3
Trang 1Windows® DNA
Enrique Madrona
Trang 2Global distributed applications with Windows DNA I Enrique Madrona.
p cm - (Artech House computing library)
Includes bibliographical references and index
ISBN 1-58053-086-9 (alk paper)
1 Microsoft Windows (Computer file) 2 Electronic data processing-Distributedprocessing 3 Internet (Computer network) 1 Title II Series
British Library Cataloguing in Publication Data
Madrona, Enrique
Global distributed applications with Windows DNA - (Artech
House computing library)
1 Microsoft Windows (Computer file) 2 Electronic data processing-Distributedprocessing 3 Distributed operating systems (Computers)-Management
1 Title
004.3'6
ISBN 1!58053-086-9
Cover design by Igor Valdman
© 2000 ARTECH HOUSE, INC
685 Canton Street
Norwood, MA 02062
All rights reserved Printed and bound in the United States of America No part ofthis book may be reproduced or utilized in any form or by any means, electronic ormechanical, including photocopying, recording, or by any information storage and re-trieval system, without permission in writing from the publisher
All terms mentioned in this book that are known to be trademarks or service markshave been appropriately capitalized Artech House cannot attest to the accuracy of thisinformation Use of a term in this book should not be regarded as affecting the valid-ity of any trademark or service mark
International Standard Book Number: 1-58053-086-9
Library of Congress Catalog Card Number: 99-089512
1098765432 1
Trang 4Visual Interdev, Visual J++, Visual SourceSafe, Visual Studio, Win32, Windowsand Windows NT are either trademarks or registered trademarks of MicrosoftCorporation in the United States and/or other countries.
Other product and company names mentioned herein may be the trademarks oftheir respective owners
Trang 5Introduction xiii
cO Resources and Additional Information XVlll
1.1 Overview of Current Global Technologies 3
1.2.2 Unix ware and Other Unix Implementations 10
Vll
Trang 6Chapter 2 Using Microsoft Technologies
27
2.2 The Distributed Internet Applications Architecture 292.2.1 Windows DNA COM and DCOM Services 322.2.2 Windows DNA Transaction Services 342.2.3 Asynchronous Communications and Queues 38
2.2.5 Universal Data Access Components 392.2.6 The Windows DNA Development Paradox 40
Chapter 3 Mapping the Technology to the Business 43
3.1 Mapping the Technology to the Business 433.1.1 Reducing the Total Cost of Ownership (TCO) 463.2 Mapping Windows DNA
48
•• 3.2.1 The Impact of Object and Component Technology 49
3.2.3 The Impact of Messaging, Communications, and
59
4.1.2 Three-Tier Client/Server Systems 61
4.1.4 Distributed Client/Server Systems 64
71
viii
Trang 74.2.6 Object Life Cycle: Instantiation, Invokation, and
4.5.1 Microsoft Data Access Components (MDAC) 91
4.5.6, Choosing a Data Access Component 97
4.6.1 Principles of MTS-based Distributed Systems 994.6.2 The Paradigm Shift: Stateful vs.Stateless Programming 1044.6.3 Building MTS-enabled Components With VB 108
5.1.1 The Microsoft Management Console 1135.1.2 lIS Process and Component Management 1175.1.3 Setting Up and Configuring a Web Site Using lIS 119
Trang 85.2.2 Visual Studio Analyzer (VSA)
5.4.5 Extensible Markup Language (XML) 136
5.5.1 ASP - Important Language Issues 138
Chapter 6 Building Global Distributed Applications 147
Trang 96.4.4 State Management
6.5 The Role of ASP in Distributed Applications 195
7.1.1 Testing Windows DNA Applications 1977.1.2 Debugging Windows DNA Applications 204
7.3.1 Setting Up the Error Handler Component 234
•• 7.3.2 Understanding the Error Handler Component 234
8.3.1 Gathering Initial Requirements 247
Xl
Trang 109.6 Enhancement and Maintenance Considerations 302
Trang 11Welcome to Global Distributed Applications With Windows@ DNA You have
probably made a number of assumptions simply by reading this title Many times,the title of a book is all you have to make a decision to purchase it The title of thisbook is deliberately long in an attempt to provide as much information as can begiven using just six words
The title has been created to cover the software development process, fromdesign and development to testing and deployment
Tfle word "distributed" simply implies that parts of the application areseparated from each other This may be because they reside on different physicalmachines (whether in the same room or across an international network) orbecause they split the application logic into a number of components that workindependently toward a common goal
The word "global" indicates that the application is accessible from a variety ofgeographical locations This does not necessarily mean on a planetary scale,although that may well be the case It simply means that the application isaccessible to users irrespective of where they are They may be located in the U.S.alone, Europe alone, Asia alone, or anywhere else in the world
These definitions represent, generally, the kind of application that this bookcovers More specifically, the book is centered on distributed client/serversystems, primarily Web-based applications This concept is finally given away bythe words "Windows DNA."
Windows DNA is Microsoft's Distributed Internet Applications Architecture:
a collection of tools and technologies specifically designed to enable theproduction of Web-centric, global distributed applications
You may use Windows DNA to produce stand-alone components, traditionalclient/server systems, or any other kind of application However, Windows DNA
is especially designed to support Web-based software systems
xiii
Trang 12Within Windows DNA, two products are of particular interest: theComponent Object Model (COM) and Microsoft Transaction Server (MTS) Bothare key to understanding Windows DNA and the foundations of this book.
WHA T IS THE PURPOSE OF THIS BOOK?
This book is not meant as a tutorial on each individual component of the DNAarchitecture On one hand, it would not be fair to the teams responsible for thosecomponents to devalue their work by attempting to cover the components in detail
in a single book On the other hand, such an undertaking would be impossible, forthe volume of information needed to describe the components in detail wouldrequire several books
DNA components such as COM, MTS, Microsoft Message Queue (MSMQ),Internet Information Server (lIS), and others deserve their own books, and in fact,many already exist covering each individual technology in detail
This book treats Windows DNA as a single entity, and where appropriate, itdescribes its individual components, their purpose, function, and fit in thearchitecture
However, the book covers applications development in the context ofWindows DNA and from a global perspective It focuses specifically on Internetand intrahet technologies using COM as a standard development platform Thebook presents its contents from a Web development viewpoint, for applicationteams developing global Web solutions
The book is not a programming manual but rather a technical discussion ofthe technologies that integrate Windows DNA, their purpose and how they can beused efficiently by development teams It additionally covers software projectmanagement techniques that are appropriate for applications designed for thisarchitecture
Most of the technologies covered in the book (such as COM) are alreadyevolving into the next generation (COM+) Where appropriate, the link betweencurrent and next-generation DNA technologies is provided in the book as well.More specifically, this work addresses the following technologies, at differentlevels of detail:
Trang 13• lIS;
• UDA, ODBC, OLE DB, ADO
It also covers the following tools:
• Microsoft Visual Basic;
• Microsoft Visual Studio;
• Microsoft Visual SourceSafe;
• Microsoft Visual Studio Analyzer;
• Microsoft Visual Modeler;
• Other Visual Studio components
The book was written to address gaps in the literature concerning theunderstanding of how the technologies work and how to resolve problems thatinevitably arise from the intrinsic complexity of the components that integrateWindows DNA Specifically, the book attempts to fill the following gaps:
• Benefits of this technology to the business organization;
• Design changes required to build DNA applications successfully;
• The role of object-oriented programming in a component world;
• Testing and debugging DNA application using Microsoft Visual Basic;
• Addressing the paradigm shift required to understand stateless applications;
• Applications of middle ware within DNA systems;
• Managing the software life cycle in this environment
At the very least, the book hopes to equip the reader with the necessaryknowledge to bridge these gaps and to that purpose, it focuses its attention on thefollowing areas:
• Effective development of highly scalable global intranet applications;
• Effective development of interoperable and reusable components;
xv
Trang 14• Understanding the differences between standard, distributed client/serverapplications and Windows DNA distributed applications;
• Understanding the relationships and interactions among the many differentcomponents of Windows DNA and the implications of these;
• Reduction of the total cost of ownership through effective use of thetechnology and a clear mapping from the technology to the business;
• Understanding the software design changes required to develop applicationssuccessfully under Windows DNA;
• Efficient detection, interpretation, and correction of errors in applicationsthat run within Windows DNA;
• Development of distributed components and their interfaces in accordancewith the COM model;
• Correctly designing and developing software components for each tier in adistributed DNA client/server application;
• Successfully managing global Windows DNA software projects using aproposed methodology among other possible approaches;
••
• Managing the global software development process from a focused perspective;
business-• Increasing the overall productivity of Windows DNA development teams
These are ambitious goals My expectations as the author are to enable thereader to achieve as many as possible
A WORD ABOUT VISUAL BASIC
The Visual Basic programming language is used throughout this book to illustrateexamples and principles of Windows DNA applications development There aretwo reasons why I chose Visual Basic as the primary tool for this book:
• On one hand, most of the technical concepts about Windows DNA currentlycovered in technical literature are illustrated using C++ I wanted to provide
a Visual Basic-centric perspective and a change from the traditional C++perspective that is normally used in this context;
• On the other, Visual Basic continues to gain popularity as the tool of choicefor building global distributed business systems, particularly for the Web It
Trang 15followed naturally that Visual Basic would be a popular language to use inthis book.
However, the use of Visual Basic in this document is not meant to beexclusive Both Visual C++ and J++ (and many other languages) can be used just
as well for the same purpose
WHO IS THE AUDIENCE FOR THIS BOOK?
In general, this book is intended, in order of importance, for these audiencegroups:
• Application developers in general and Web application developers inparticular: This audience will find the book useful as both a reference and as
a guide on how to develop applications for the technologies discussed;
• Application development managers, program managers, senior developers,anQ.other software project managers: This audience will find that the bookbridges the gap between technical issues and management issues It providesnot only the necessary background to understanding the technology but alsotwo full chapters on how to manage projects in this environment;
• IS managers: This audience will find the first three chapters of the bookparticularly useful, because they explain how the technology serves theneeds of the business and how certain practices, policies, and proceduresimpact the productivity of development teams in this environment and theirability to deliver business solutions;
• System managers, system architects, and other IS administrative groups:This audience will find the book useful because although centered primarily
on development, most of the technologies described in the book are notmanaged by software developers but by system administrators or architects.These groups will find it useful to understand how developers use the sametools and technologies and where common problems and common issuesarise;
• Trainers and instructors in this technology: This audience will also find thebook useful as supporting material from which classes can be built orsample lab scenarios compiled This is particularly true of instructors whomay be trying to move developers away from traditional development tostateless applications or correct use of the middle ware engines
xvii
Trang 16SKILLS NEEDED TO READ THIS BOOK
This book assumes that the reader is an intermediate-level programmer withexperience building applications (preferably object-oriented) that have at least auser interface and a database back-end Alternatively, the book assumes that thereader has some background in software engineering or computer science
Experience with client/server systems is a bonus, while exposure to Microsoftdevelopment tools, such as Visual Studio, is preferred Some exposure toWindows DNA components such as COM, MTS, or lIS is expected but notrequired
Some sections of the book concentrate on resolving problems that arise duringthe construction and execution of DNA applications These sections assume somefamiliarity with analyzing and debugging a simple Visual Basic program
STRUCTURE OF THE BOOK
This book is divided into four sections Section I, Global Technology, includesChapters 1 to 3 and focuses on operating systems and Windows DNA components.Section II, Global Architecture, includes Chapters 4 through 7 and focuses ontechnical development and the architecture itself Section III, Managing the GlobalProject, includ~s Chapters 8 and 9 and focuses on the software development andproject management aspects Finally, Section IV is a collection of resources andreferences These sections may be read independently of each other
RESOURCES AND ADDITIONAL INFORMATION
As well as the resources, references, and links provided in Section IV there is aWeb site that accompanies the book To access the Web site point your browser atthe following URL: http://members.stratos.net/enrique. The book site will beavailable from December, 1999 and will contain work, reference material,documentation, and code related to all Windows DNA components presented inthis book
The Web site will also provide for updates on the book, errata, feedback, andother relevant information
I sincerely hope that this book will be valuable to you The primary goal inproducing it was to serve you, the reader If you have any suggestions, feedback orideas, or simply wish to contact me regarding any part of this book, please feelfree to use the e-mail address below
If you have any questions or would like to talk about the material presented inthe book, you are also welcome to use the following e-mail address:
Emor@ieee.org
Thank you for using this book
XVlll
Trang 17I would like to take advantage of this acknowledgment page to mention myappreciation for a number of people who have influenced me very positively bothprofessionally and personally and whose help and inspiration have made this workpossible.
First, I would like to thank Artech House for giving me this tremendousopportunity In particular, I would like to thank Ms Susanna Taggart, whointercepted my original e-mail containing the idea for this book Thanks also to
Mr Michael Webb for working with me hand in hand in getting over the obstacles,.and completing the manuscript
I would also like to show my gratitude to the technical reviewers on whom Irelied heavily throughout the production of this work I had the pleasure ofworking with expert reviewers whose influence shaped the final text, chapter bychapter Thanks also to Ms Vicky Oliver, Ms Ruth Young, Ms Valerie Moliere,
Ms Hilary Heindl, and the rest of the people at Artech with whom I have had thepleasure to work
Second, I would like to thank my colleagues and friends at the MISdepartments of the Lubrizol Corporation at Wickliffe, Ohio and Hazelwood,England, from whom I have learned substantially In particular, I would like tothank Mr Yannick LeCouedic and Ms Leslie Lakatos for considering andgranting permission for the production of this work
Special thanks to all my friends at Lubrizol Hazelwood, particularly Rick,David, Andy, Guy, Matt, Steve, Roy, and John Most special thanks to Rick for hishelp during the years I worked at Hazelwood and afterward
Special thanks also to my colleagues at Wickliffe, in particular the members
of the PAP and GBTRS teams: Jenny, Ellen, AI, Jim, and Jeff I must credit themfor being the source of many of the ideas that led to this book
I also had the pleasure to work with a team from D and T and I would like tothank particularly Eric Starkman and Jeff Pingston I learned a lot from them andthey authored many of the components we use today, including much of theexception handler discussed in Chapter 7 of this book
XIX
Trang 18Thanks to my Uncle Melquiades, who introduced me to computers andsoftware development I still remember CP/M-85, "PIP A:=B:* *" and the day Irewrote the ROM-Basic memory using POKE instructions, translating its errormessage strings from English to Spanish I also remember reading the BIOS codefor CP/M-87 as if it were a science fiction novel, and writing assembler code toenhance theas.
Thanks to all my family in Spain for believing in me Thanks in particular to
my mother, Victoria, my brother Javi and my sisters Vito and Rocio Specialthanks to my father, Enrique, to whom I have always looked up with respect as anexample
Finally, I want to reserve this paragraph especially for my wife, Eva, whoproduced all the graphic files used in the book, and my children, Laura, Bondi,Chico, and Claudia, for their daily presence, their inspiration, their support, and forletting me drag them around the planet Thank you for allowing me to postponewriting the story of "The Rabbit Stinky Toes and His Friends" so that I couldfinish this book I love you all
xx
Trang 19Global Technology
Trang 20Platforms and Technologies
1.1 OVERVIEW OF CURRENT GLOBAL TECHNOLOGIES
From its beginnings, the software development process has found itself on a questfor excellence, in part for its traditional desire to evolve into a formal engineeringdiscipline with the ability to measure, predict behavior, and construct modularsoftware accurately, from the ground up On the other hand, the softwaredevelopment process strives to create a complete and stable finished product withminimum complexity, in a constantly changing environment with constantlychanging requirements
Cap~tal among the long-standing goals of the development community are thefollowing major objectives:
• Reusability: The ability to build software from existing working softwaremodules or components without the need to redevelop functionality;
• Interoperability: The ability to produce software that can function ondifferent machines, operating systems, and platforms and communicate withother software in a standard manner;
• Scalability: The ability to make software grow and adapt to more advanced
or more demanding technology This may be prompted by an increasingnumber of users, larger demand for data, distribution of softwarecomponents at different locations, or different conditions of stress andusability
In this quest, software systems and processes find themselves in constantevolution, from the original punched cards and early calculators to modem object-oriented systems The evolutionary process adds tremendous complexity to theengineering effort The environment in which we build systems today shares only
a small common ground with the past and a great deal of common dreams
3
Trang 21For business software systems the evolutionary curve has been even steeper,
as additional challenges are introduced by continuously changing businessorganizations and a general trend to maintain a global presence in the market.Notable among these challenges is the need to produce more intricate andcomplex software more efficiently and at lower costs, and the requirement to makesoftware systems available to the enterprise organization worldwide at all times
As more and more organizations become global, so do their business systemsand the processes necessary for their survival The result is an inevitably closerpartnership between Information Technology (IT) departments and their businesscounterparts Today, information systems must not only achieve their justifiedengineering goals but they must also make business sense The ultimate goal ofthis partnership is indeed:
Teams may consist of developers that reside in different countries around theworld, each developing different system components These components mayreside on different computers at different locations and must maintain informationconsistently and, in many cases, asynchronously
Software modules must be deployed across networks without disrupting thefunctional order and cohesion of other modules The development process itselfmay be distributed, requiring components from across servers or networks to co-operate in the development, debugging, or testing stages
The challenges of managing global projects increase proportionally as teamsmay be separated by a number of time zones, different languages and cultures, andeven by different standards or business requirements
The solution that corporate organizations arc using to address the most criticalissues resulting from globalization are rather straightforward:
Trang 22• Standardization of policies, procedures, systems, and operations worldwide;
• Integration of products and services, forming alliances with selectedsuppliers (who normally have a global presence too), and where possible,buying product and support from the same company;
• Use of global technology (integrated office applications, e-mail, voice mail,video conferencing technology, Internet-specific technologies and tools,etc)
In view of this trend toward global distributed systems and global processes,many companies turn to the Internet and e-commerce Indeed, the Internet isquickly establishing itself as the dominant force for the development of globaldistributed applications as more and more legacy operations are ported into Web-enabled client/server systems
The private versions of the Internet, the intranet and its close relative, theextranet, are becoming the battlefield for corporate software development.Traditional client/server systems are moving to the Web at an exponential rate and
<lIVenmainframe systems offer a Web front end at increasing speed
The client/server architecture itself has now achieved its goal It no longerrelies on a two-tier architecture Today's systems rely on no less than three tiersmaking it clear that the separation of business rules, database services, and userservices is a fact
Figure 1.1 illustrates a typical three-tier system Data and database-specificprocesses are stored on the database server (data tier), business and application-specific logic are stored on the business application server, and finally, user andgraphical services are stored on the client computer
Trang 23There is also a clear trend toward centralizing at least the most important parts
of business and software processes at one or more servers Centralizing businessprocesses allows for application and business-specific logic to reside on the server,away from the client, where it can be better protected and maintained In thisenvironment clients normally handle only user or presentation services, thusleading to a server-centric model with relatively thin clients and a furtherseparation of tiers
By centralizing at least part of the software development process at one ormore servers, it is possible to coordinate the production efforts of large teams orteams with remote members At the very least, configuration management, versioncontrol, requirements maintenance, and testing/debugging should be coordinatedthrough one or more team or project servers (The centralization topic is covered
in detail in later chapters.)
To enable application developers in global organizations to achieve theirbusiness objectives, modern IT departments must carefully build an architecturethat is capable of offering distributed, Internet-enabled services with the followingproperties:
• Complete interoperability;
• Full'internet support (including full support for TCP/IP and HTTP);
• Productivity-oriented development tools and simplification of deployment(ease of rolling out the application or other components to the clientcommunity);
• Maximum scalability
In this book, we will study in detail one environment that supports thisarchitecture It is widely used, Internet based, and it is implemented on top of theMicrosoft Windows NT operating system This environment is by no means theonly one and although we will focus the rest of the book on it, I would like tomake some reference to other leading environments, platforms, and tools
There are many software vendors that offer a larger or smaller portion of allthe technologies required for the production of global distributed systems, but only
a handful of these are capable of offering the whole spectrum of solutions
There is no specific impediment to adopting a solution that would combinetechnologies from different vendors and integrate them successfully However,modern standard corporate environments driven by close partnerships withsuppliers appear to show that vendors capable of providing all services as a whole,integrated package have more appeal; the business rational behind this is obvious
Trang 241.2 ENTERPRISE OPERATING SYSTEMS
The backbone of the global information systems architecture is the enterpriseoperating system Modern operating systems are complex and sophisticatedprograms, which are not limited to offering shared user and printer services orother basic networking services Modern operating systems have a graphical userinterface and offer a large range of integrated technical services These include:
• Process and thread management and multitasking;
• Asynchronous queue services;
• Symmetric multiprocessing;
• Internetworking capabilities;
• Embedded software development API and developer support;
• Integrated security;
• Local and remote administration and configuration features;
I User, group, and directory management functions;
• Integrated Web services (embedded FrP, HTTP, and World Wide Webapplication support)
All leading operating systems available today are truly global, and new oremerging ones surface with global applications in mind
However, what characterizes modern global operating systems over all othertechnical features is their ability to add value to the business and its processes ITorganizations today are looking at lower costs of ownership both for hardware andsoftware They are not easily impressed by the ability of an operating system toreduce processing time by a few seconds on one specific microprocessor oranother
Operating systems must fit in well within the overall business strategy andthey must deliver business value The ability of an operating system to provideapplication services tightly integrated with database and network services iscrucial for the development process It maximizes productivity and reducesoperating and production costs
Global or enterprise operating systems therefore must offer not only technicalcompetitiveness but also business competitiveness, by:
Trang 25• Being reliable, stable, and globally available;
• Offering simple and efficient management (such as remote administrationand remote installation);
• Supporting clustering, where more than one server can join forces withother servers and act as one single entity;
• Having a simple architecture and a simple support policy
Examples of well-known enterprise operating systems in the market (note thatthis is a small illustrative list):
• Microsoft Windows NT Server;
• Solaris, from Sun;
• Linux, from Red Hat (and other vendors.)
1.2.1 Microsoft Windows NT Server
Microsoft Windows NT Server is the flagship of Microsoft Corporation It is arelatively new product when compared to Unix but mature in computer terms.Currently rated around 40% of the total market share, NT Server has come a longway in the enterprise arena
Home to the Windows DNA architecture (described in Chapter 2, and thefocus of this book), Windows NT Server has a low total cost of ownership andoffers a fully integrated enterprise solution
Because of Microsoft's unique position as a provider of operating systems andintegrated application services, many companies opt for NT Server and MicrosoftBackOffice products Together they offer integrated network, application,messaging, database, development, and Internet services in one package, thuspromoting a unified, single standard platform
Trang 26There are some additional Microsoft software products specifically designedfor Windows NT Server, such as Internet Explorer, Microsoft Outlook, VisualStudio, Microsoft Transaction Server, and Microsoft Message Queue.
On the technical side, NT Server provides an extensive range of services:
• File, printer, and user management services;
• High interoperability by means of Windows DNA and the COM protocol;
• Unified development platform (modeling, development, analysis and testingtools, and application programming interfaces - API that function together);
• Cluster services;
• Symmetric multiprocessing;
• Multiplatform support;
• Remote Administration;
• Multiple database services (ADO, RDO, ODBC, OLE DB, etc.);
• "Full TCP/IP native support;
• Integrated security
The Windows DNA components built on top of NT Server add another layer
of technology critical to the operating system and its services, such as:
• Full support for HTML, DHTML, and XML;
• ActiveX DataObjects, ActiveX technologies, OLEDB, and ODBC;
• Numerous application programming interfaces;
• Several scripting engines;
• A multitude of support objects
There are thousands of applications developed for this operating system andone of the largest communities of application developers The services indicatedabove, and in particular the Windows DNA architecture, will be studied in detailthroughout this book
Trang 271.2.2 Unixware and Other Unix Implementations
As mentioned above, this book will cover specifically the Microsoft solutions forglobal applications development However, I would like to mention at least threemore competing solutions widely used for the same purpose These are by nomeans all the available products (other companies such as Novell and Oracleprovide similar products) They represent other prominent platforms, which wouldmerit their own dedicated book
After changing hands several times the Unix ware product is now back withSCO (Santa Cruz Operation) Previously owned by Novell, the product has beentransformed after several changes and mergers with other products from SCO.From a technical point of view Unixware's architecture is probably moresophisticated than NT, with its 64-bit API and the NETBeui protocol
Unix ware is a reliable and stable product with many years behind it It is aproven business solution and a leading operating system
Unlike Windows NT Server, Unix ware belongs to a family of Uniximplementations that include POSIX, AIX, XENIX, ULTRIX, and many othersimilar products
Unixw<lje, like NT, provides a full range of enterprise services, among them:
• Web-based server administration;
• Full support for CORBA and ORB (as opposed to Microsoft's COM!
DCOM);
• Full range of security and security administration features;
• Embedded Web capability and full support for HTTP and TCP/IP;
• Built in Netscape services such as messaging, Communicator, DirectoryServer, etc.;
• Extended portability and full support for applications development;
• Cross-platform support
Unix ware is at the same level as NT Server for enterprise support Some ofthe most important differences between the two operating systems lie perhaps inUnix's:
• Open source foundations as opposed to Microsoft's more proprietaryapproach;
Trang 28(particularly in client/server systems) where software is generally moving towardinterface and component-based systems.
Companies have also come to the realization that the Internet further reducesthe total cost of ownership for both software and hardware through the use of aWeb server (where business logic is centralized) and a browser for a client
The Web environment allows for a large number of users to connectsimultaneously to the Web server, access distributed resources, and perform theirbusiness tasks easily, from anywhere in the world, using a simple browser as aclient
The browser provides all the necessary user and presentation (graphical)services to the client in an effective and low-cost fashion There is a choice as tohow much intelligence (processing power) is necessary on the client computer.Some argue none (proponents of the Network Computer, for instance) while someprefer to use as much processing power available on the client as possible
Certainly, the choice of little processing required at the client further allowsfor smaller, cheaper, and more standard workstations to which the user does notrequire to have administrative privilege, thus further reducing the support burden
On the server side, the Web server, the operating system, and the hardwarecan also M' easily standardized and configured to use unique Internet protocols and
a fixed range of configuration parameters that allow simple management andadministration
The additional fact that application and database servers already come withintegrated support for the Internet makes this environment ideal for sharing globalresources Even if the business user simply has a small laptop computer with a28.8 modem attached to it, it will still be possible to take advantage of theseresources by dialing up to the server
However, the Internet is well known for allowing users to log onanonymously and for security breaches, viruses, and similar threats Any corporateenvironment will be wary of deploying mission-critical and strategic applications
in this environment
Because of this, corporate IT organizations have turned to the intranet Theintranet is a secured version of the Internet that allows for secured authenticationand access to the global resources offered by the server Secured, however, doesnot mean invulnerable It simply imposes tighter controls over who can accesswhat resources
Typically this job is performed by a firewall who serves several purposesincluding challenging the user as it attempts to enter the network, encrypting anddecrypting data, etc
Intranets are private and secured versions of the Internet They allow thedeployment of strategic business applications in this environment with the peace
Trang 29of mind that they are as secured as can be and fully under the control of theorganization.
Intranets have one further advantage over the Internet: they allow muchdeeper standardization of tools and technologies For instance, a global applicationdeveloper creating business applications for the Internet must ensure that theapplication will perform its functions regardless of the type of browser or clientthat is accessing it In an Internet environment, this means that the developer mustprovide functionality for both Microsoft Internet Explorer and Netscape Navigator(just to quote two well-known browsers) and perhaps maintain a variety ofscripting languages, objects, controls, etc
The object model and API exposed by these two browsers differ sufficiently
to force the developer to predetermine the kind of browser that is connecting to theapplication and provide dual support code for one case or another
When running within the company's intranet there is no need for suchdistinction (unless of course the company wishes to support multiple browsers,which defeats two of the primary objectives of the intranet: lower costs and greaterstandardization)
It is perfectly reasonable to expect the IT organization responsible for thecorporate intranet to choose only one browser platform and only one set oftechnologies for use within the organization's network As indicated above, this isnot mandatory It simply makes business sense
Developing business software for the intranet, however, is very different thanthat done for other development environments The Internet/intranet environment
is truly global and truly distributed, and certain assumptions and establishedpractices fully acceptable in a traditional client/server environment are notapplicable here
Among the most important differences, we might mention the following:
• Large number of ad hoc connections;
• Asynchronous communication between client and server;
• Nonpersistence of user connections;
• Different object model and application programming interface;
• Server-centric information processing;
• Full separation of processing tiers
These differences bring serious departures from traditional application designand development practices Examples of such differences are:
Trang 30• Increased potential for resource locking and contention due to increasedfrequency of access to the application and the server;
• The connection with the client is short lived Once the client reaches theselected page in the browser the connection to the application and itsdatabase disappears The application cannot rely on objects or connectionsbeing there by the time it leaves the page (nonpersistent connections);
• The application cannot assume that it can use the client's resources (this istypically problematic for ActiveX controls) Some organizations choose tosecure the client and prevent the application from storing any data on theclient computer;
• Database, business, and user services may not even exist in the same server.They may not even be active at the same time
This is the result of an inevitable trade-off that imposes a more strictdiscipline in the development approach needed in an intranet or Internetenvironment Consider as an example that in order to allow the server to handle asmany connections as possible, it may allow any number of clients to connect Itmay also choose to disconnect a client that has been idle for a certain amount oftime, thus allowing another client (that would otherwise have to wait) to gainaccess to the application The disconnected client is now off-line and itsapplication must not rely in the persistence of the connection, data, or any otherlink that it had to the server
In exchange for the added design complexity, the intranet platform offerssome major benefits and advantages to the business application These benefitswould be cost-prohibitive in other environments and are primarily centeredaround:
• A unique connection protocol, HTTP;
• A global internetwork protocol, TCPIIP;
• A common presentation and graphical interface;
• A universal client, the browser;
• Centralized server services
The environment is also platform independent, allowing the client to have noconcern for what server it connects to, where it may be, or how it performs itsbusiness functions The result is a global distributed environment where the client
Trang 31will simply connect when it needs to, from wherever it is located, find theresources it needs and disconnect when it needs to as well.
For the intranet developer, on the other hand, despite the increasing simplicity
of Web development tools and environments, old problems have grown to newlevels:
• Application components are now location independent They may belocated on one central machine or they may reside on several servers acrossthe network;
• There are at least three different application tiers: business, data, and user.They should be completely separate and may again reside at differentlocations;
• Introduction of multiple distributed transactions;
• Unpredictability in the use and persistence of resources (such as businessobjects, database connections, memory, etc.);
• Added complexity in testing and debugging applications Development
•• tools may be based on the developer workstation, but the component beingdebugged may exist on a server across the network Testing may nowrequire substantial stressing of the application to test its tolerance to a highnumber of users;
• Introduction of a further level of abstraction between the client and theserver
1.4 INTERNETWORK PROTOCOLS AND TECHNOLOGIES
We covered certain aspects of the architectural environment of modem intranetglobal applications in earlier sections, from operating systems to potential designand development changes in the engineering process Specific details about thesepotential changes are given in Section II
Nevertheless, what are the technologies that have enabled this environment as
a standard for global applications development?
A core set of technologies and a larger number of support tools make thisenvironment possible The technologies in question are:
• HyperText Markup Language and all its variations;
• HyperText Transfer Protocol, needed to communicate in the Internet;
• Internetworking protocols such as TCP/IP
Trang 32The tools used by the Web developer to construct applications on top of theseare, among others:
• Scripting languages and engines such as Javascript, VB Script, and ASP;
• Markup languages such as HTML, XML, and DHTML;
• Process protocols such as COM, DCOM, and CORBA;
• Middleware and transactional engines such as ORB, Enterprise Java Beans,and Microsoft Transaction Server;
• Flexible programming environments such as C++, Visual Basic, Java,Delphi, etc
1.4.1 HyperText Markup Language (HTML)
The HTML language is specified by the World Wide Web Consortium (or W3C)and it,.is specifically designed to transfer static (or document) content to and from
a Web server using the HTTP protocol
HTML is a simple text-based language consisting of tags, embedded in theinformation stream that passes through the Web server and capable of convertingdocuments from their original format to one that can be displayed on a Webbrowser
HTML is standard and universal and it is mostly used to display staticcontents where there is no need for the document to interact with the server(documents whose content do not change)
HTML is in constant evolution and is currently at version 4.0 In its presentform, HTML is also capable of providing a basic object model (a collection ofobjects such as an edit box and events such as a mouse click) Applicationdevelopers can use the object model in the production of Web-based applications.The object model is directly dependent on the browser (it therefore variesslightly from browser to browser) Figure 1.2 is a sample fragment from an HTMLsource file
Trang 33Figure 1.2 Sample HTML code fragment.
1.4.2 HyperText Transfer Protocol (HTTP)
Communication between a Web server and a client is rather simple Theyexchange a stream of text (or ASCII data) This communication takes place withinthe parameters defined by the HTTP protocol HTTP manages browser requests toand from the server and it delivers data in the form of HTML text streams
One of the most important characteristics of HTTP is that it follows the 'Just
in time activation as soon as possible deactivation" connectivity model HTTPintercepts the client request for HTML, serves the request to the client, anddisconnects the client from the server Most of the interaction between the clientand the browser is "connectionless" since HTTP connects only when it needs toand it disconnects immediately after serving a request
The purpose of this behavior is to maximize the efficiency and utilization ofthe server resources by allowing more clients to connect to the server whileconserving these resources through immediate disconnection of the client
A server has only a limited set of resources By serving multiple connections
on demand and disconnecting them immediately, HTTP enables the server toaccept requests for a number of clients well above its maximum capacity
HTTP is not the only Internet protocol There are other protocols with otherspecific functions, such as Gopher, FIP, NNTP, MailTo, etc
Trang 341.4.3 Transfer Control Program and Internetwork Protocol - TCP/IP
The HTTP protocol defines the set of rules necessary to communicate over theInternet By itself, HTTP cannot provide the services necessary for Web-basedapplications to communicate across the network It requires a transport protocolknown as TCP/IP
The TCP/IP (Transfer Control Protocol and Internetwork Protocol) protocolstack is the most important networking protocol existing today for Internet-enabled applications It is fast, efficient and universal HTTP itself is a TCP/IP-based protocol that relies completely on the latter for all its functions
The protocol consists of two parts:
• TCP: managing the transfer of data among computers, components, orapplications;
• IP: controlling the flow of packets of information and their addresses(origin and destination points of this information)
The TCP/IP protocol relies on "addresses" to make devices communicate Allcomputers and networks of interconnected devices possess unique identificationnumbers called addresses that specify their location on the global network
The protocol stack is capable of holding the address of the origin anddestination points for the information, wrapping up the information in packets, andsourcing it between two or more address points The TCP/IP protocol stack canaddress billions of locations
IP packets travel around the network from server to server, bridge to bridge,router to router, and modem to modem in search of the destination address untilthey eventually get there
Once a client connects to a server, the network nodes, routers, and serversinvolved in getting the information from the client to the server are anyone'sguess (Figure 1.3 illustrates a client making a request to a server, somewhere onthe network.)
Trang 35Figure 1,.3 Client requests service from Server 3 on the network.
1.4.4 Support and Development Tools
To best use the services and resources provided by the languages and protocolsidentified above, a set of specialized tools is required
These tools can be categorized in the following four groups:
• Scripting languages and engines;
• VB Script: Developed by Microsoft Corporation, this scnptmg languagerepresents a subset of the Visual Basic programming language It isextensively used due to the large number of VB and VBA developers that
Trang 36can leverage their Visual Basic expertise and utilize an Internet scriptinglanguage that they do not need to learn;
• JavaScript: Developed by Netscape, this scripting language is also veryextensively used and it is normally the standard for client-side scripting (It
is browser independent.) It is based on the Java language, itself based on theC++ language, and it shares syntactical elements with both
Both VB Script and JavaScript are excellent tools for introducing aprogramming interface into the HTML block It is perfectly feasible to use bothscripting languages and mix them within the same source file Figure 1.4 showstwo example code fragments, one from VB Script and the other from JavaScript.1.4.4.2 HTML Extensions
As indicated above, the HTML language is in constant evolution Revision 4.0 ofthe HTML standard itself has added many support elements to the language.However, perhaps the two most impressive variations of HTML are DHTML andXML
,.
Figure 1.4 Sample VBScript and JavaScript code fragments.
Trang 37The Dynamic HTML or DHTML language extensions increase the power ofthe HTML specification by adding more objects to the HTML object model.DHMTL also adds more sophisticated events, functions, and features, such asCascading Style Sheets (CSS) Overall, DHTML adds a set of enhanced elementswhose purpose is to make HTML more similar to the traditional features andcontrols that one can find in languages such as Visual Basic Before DHTML, theresources for the Web application developer to build usable, well-organized Webpages was very limited With DHTML, one can approach the construction of theuser interface elements as if it were any other graphical programming tool SeeFigure 1.5 for an example DHTML fragment.
The Extensible Markup Language extensions (XML) are much morespecialized than DHTML XML is primarily data driven and it offers thedeveloper the possibility of customizing the HTML stream to the application needs(tags may represent entities, objects, data elements or transactions) Its moreimportant feature is its ability to customize language tags to specific objects thatmap to business objects (or database elements) within the application See Figure1.6 for an example XML fragment
Figure 1.5 DHTML sample fragment
Trang 38Figure 1.6 XMLsample fragment.
1.5 BROWSERS
Global systems based on the Internet are client/server systems Unlike traditionalclient/server development, where applications typically run in one platform for aspecific function and group of users, Internet applications must accommodate anynumber of users connecting to any number of servers on any platforms andanywhere The beauty about this client/server model is that the client needs toknow nothing about the server, the platform, or the network to which it isconnected
Clients in an Internet client/server environment are known as Web clients Ofall possible Web clients the Web browser is the most flexible and widely used
A browser is a specialized tool whose only mission is to interpret HTMLstreamed data This data is then displayed for the user to see and interact with andsent back to the server (converted back to HTML) for further processing ifrequired A browser is an enormous achievement in terms of simplicity andinteroperability
When we talk about clients we must make a distinction between "thin" clientsand "thick" or "fat" clients A thin client is one where processing is kept to aminimum and the flow of information between the client and the server tends to bekept to a minimum as well, leaving the server to do most if not all of the work
Trang 39A fat client on the other hand tends to perform parts of the processing of the application or business logic It may not contact the server too frequently but when
it does the flow of information tends to be larger This is usually due to the need to download processing logic and rules (sometimes in the form of executable programs or controls) to help with the local processing of data.
Web-centric environments favor the thin-client approach because it minimizes the traffic of information between client and server The approach also favors the centralization of business logic at the server, leaving the client to simple tasks such
as data representation, validation, and display (or presentation).
In the end, whether you choose to implement your application in a thinner or thicker client environment is more of an architectural choice than a development one and it depends on the needs of your application.
Generally, business processes and business-specific logic should reside on the server Otherwise, your business logic is spread over your client base; it is difficult to manage multiple access to it and to protect it from unauthorized access For similar reasons, the database tier should reside on the server as well.
Tapping into the resources of the client for anything else for the purpose of alleviating,.theload on the server is also good practice.
Multitiered distributed applications tend to use thinner clients as the number
of tiers increase In typical three-tier applications where business, data, and presentation logic are fully separate, it becomes easier to reduce the processing of the client side as logic becomes encapsulated within the application and the database server.
The best example of a thin client is again a Web browser (Although as indicated above, the developer maintains a choice of delegating more or less processing to the client This is particularly true of ActiveX controls).
There are many commercial Web browsers available in the market The two dominant ones are Microsoft Internet Explorer (currently at version 5) and Netscape Navigator (at version 5 too) These two browsers represent virtually the entire market.
By definition, the two browsers perform the same function and also have equivalent features What differentiates them from one another is the added support for Web development and a moderately different user interface.
Netscape Navigator is more generic and universal It appears to occupy a place of preference in the development community and in environments that are non-Microsoft-centric or a combination of Microsoft and non-Microsoft solutions.
To allow the client computer to perform any necessary local processing (as indicated above), browsers typically include support for application programming interfaces This allows the developer to access the client computer and alleviate the load on the servers by performing local operations such as data validation, animation, etc.
Trang 40Netscape Navigator adds Java support and it uses the JavaScript scriptingengine as a standard Microsoft Internet Explorer supports Java and JavaScript aswell, and additionally, it includes support for Microsoft's primary scripting engine,
VB Script Microsoft Internet Explorer also supports the range of ActiveXtechnologies and controls created by Microsoft (and a multitude of third-partycompanies)
Internet Explorer is essentially an integral part of Microsoft DNA It is fullyintegrated in this set of Microsoft technologies and it provides a rich set ofapplication programming interfaces, as indicated above
Both browsers support HTTP l.x and the latest HTML specifications Theyenhance the HTML model by providing extended object support, such as stylesheets, sophisticated frames, DHTML, etc Additionally, they build upon thestandard HTML object model by providing extra objects, controls, HTML tags, anew event model, etc
Support for an enhanced object model as provided by modern browsers hasbrought Web development to the same levels as traditional client/serverdevelopment Today's browsers provide the developer with a rich, graphical
•• collection of objects, properties, events, and toolboxes