📄 ch01.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD><SCRIPT LANGUAGE="JavaScript"><!--function popUp(pPage) { var fullURL = document.location; var textURL = fullURL.toString(); var URLlen = textURL.length; var lenMinusPage = textURL.lastIndexOf("/"); lenMinusPage += 1; var fullPath = textURL.substring(0,lenMinusPage); popUpWin = window.open('','popWin','resizable=yes,scrollbars=no,width=525,height=394'); figDoc= popUpWin.document; zhtm= '<HTML><HEAD><TITLE>' + pPage + '</TITLE>'; zhtm += '</HEAD>'; zhtm += '<BODY bgcolor="#FFFFFF">'; zhtm += '<IMG SRC="' + fullPath + pPage + '">'; zhtm += '<P><B>' + pPage + '</B>'; zhtm += '</BODY></HTML>'; window.popUpWin.document.write(zhtm); window.popUpWin.document.close(); // Johnny Jackson 4/28/98 }//--> </SCRIPT> <META NAME="Author" Content="Bryan Flores"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1"> <TITLE>Teach Yourself CORBA In 14 Days -- Ch 1 -- Getting Familiar with CORBA</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF"><CENTER><H1><IMG SRC="../button/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR><FONT COLOR="#000077">Teach Yourself CORBA In 14 Days</FONT></H1></CENTER><CENTER><P><A HREF="../fm/fm.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch02/ch02.htm"><IMGSRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> <HR></CENTER><CENTER><H1><FONT COLOR="#000077">Day 1<BR>Getting Familiar with CORBA</FONT><A HREF="#Heading1"></A></H1></CENTER><UL> <LI><A HREF="#Heading1">The Purpose of This Book</A> <LI><A HREF="#Heading2">Background: History of Distributed Systems</A> <UL> <LI><A HREF="#Heading3">The Beginning: Monolithic Systems and Mainframes</A> <LI><A HREF="#Heading4">The Revolution: Client/Server Architecture</A> <LI><A HREF="#Heading5">The Evolution: Multitier Client/Server</A> <LI><A HREF="#Heading6">The Next Generation: Distributed Systems</A> </UL> <LI><A HREF="#Heading7">Why CORBA?</A> <UL> <LI><A HREF="#Heading8">Exploring CORBA Alternatives</A> </UL> <LI><A HREF="#Heading9">CORBA History</A> <UL> <LI><A HREF="#Heading10">Introducing the Object Management Group (OMG)</A> <LI><A HREF="#Heading11">CORBA 1.0</A> <LI><A HREF="#Heading12">CORBA 2.0 and IIOP</A> </UL> <LI><A HREF="#Heading13">CORBA Architecture Overview</A> <UL> <LI><A HREF="#Heading14">The Object Request Broker (ORB)</A> <LI><A HREF="#Heading15">Interface Definition Language (IDL)</A> <LI><A HREF="#Heading16">The CORBA Communications Model</A> <LI><A HREF="#Heading17">The CORBA Object Model</A> <LI><A HREF="#Heading18">CORBA Clients and Servers</A> <LI><A HREF="#Heading19">Stubs and Skeletons</A> <LI><A HREF="#Heading20">Beyond the Basics: CORBAservices and CORBAfacilities</A> </UL> <LI><A HREF="#Heading21">Summary</A> <LI><A HREF="#Heading22">Q&A</A> <LI><A HREF="#Heading23">Workshop</A> <UL> <LI><A HREF="#Heading24">Quiz</A> </UL></UL><P><HR SIZE="4"><CENTER><H1><FONT COLOR="#000077"></FONT></H1></CENTER><H2><A NAME="Heading1"></A><FONT COLOR="#000077">The Purpose of This Book</FONT></H2><P>Certainly, this isn't the first book to be written on the subject of the CommonObject Request Broker Architecture (CORBA)--not by a long shot. However, among CORBAbooks currently on shelves, it might be unique in its approach. At the time thisbook was written, few, if any, texts were available that covered CORBA at an introductorylevel. This book attempts to fill that gap.</P><P>CORBA is not a subject for the fainthearted, to be sure. Although developmenttools that hide some of the complexity of CORBA exist, if you embark on a projectto develop a reasonably sophisticated CORBA application, chances are that you willexperience some of CORBA's complexities firsthand. However, though there might bea steep learning curve associated with CORBA, a working knowledge of CORBA fundamentalsis well within the grasp of any competent programmer.</P><P>For the purposes of this book, it is assumed that you already have a good dealof programming experience. CORBA is a language-independent architecture, but becauseC++ and Java are the principal languages used to develop CORBA applications, it wouldbe preferable if you had experience with one of these languages. (Most of the examplesare written in C++, with a healthy dose of Java thrown in for good measure.) It wouldn'thurt if you were familiar with object-oriented analysis and design concepts either,but just in case you need a refresher, this book will help you review these concepts.</P><P>Operating under the assumption that learning CORBA is a surmountable (if daunting)goal for most programmers, this book begins teaching the fundamentals of CORBA, startingwith an overview of the architecture. You'll then move on to a primer on the InterfaceDefinition Language (IDL), a cornerstone on which most CORBA applications are based.After that, you'll start building CORBA applications, and before you know it, you'llbe exposed to advanced concepts and design issues, along with other useful thingssuch as CORBAservices, CORBAfacilities, and the Dynamic Invocation Interface, orDII (don't worry--you'll learn what all this means, in due time). All this--and more--ina mere 14 days.</P><P>What this book does not do--indeed, cannot do--is make you a CORBA expert overnight(or even in 14 days, for that matter). It does put you well on your way to masteringCORBA. Keep in mind that CORBA is a complex architecture, full of design issues andtradeoffs as well as implementation nuances. As such, it can only be mastered throughexperience--something you will gain only by designing and developing CORBA applications.Perhaps this book does not make you an expert in all things CORBA, but it does putyou on the right track toward achieving that goal.<H2><A NAME="Heading2"></A><FONT COLOR="#000077">Background: History of DistributedSystems</FONT></H2><P>If you're interested enough in CORBA to be reading this book, you probably knowa thing or two already about distributed systems. Distributed systems have been around,in one form or another, for some time, although they haven't always been called thatand they certainly haven't always had the flexibility that they do now. To discoverwhere CORBA fits in, let's briefly review the history of distributed systems, startingwith the venerable mainframe.<H3><A NAME="Heading3"></A><FONT COLOR="#000077">The Beginning: Monolithic Systemsand Mainframes</FONT></H3><P>In the beginning (or close to it), there was the mainframe. Along with it camehierarchical database systems and dumb terminals, also known as green screens. Mainframesusually cost a great deal to maintain but were capable of serving large numbers ofusers and had the advantage (or disadvantage, depending on one's point of view) ofbeing centrally managed.</P><P>Software systems written for mainframes were often monolithic--that is, the userinterface, business logic, and data access functionality were all contained in onelarge application. Because the dumb terminals used to access mainframes didn't doany of their own processing, the entire application ran in the mainframe itself,thus making the monolithic architecture reasonable. A typical monolithic applicationarchitecture is illustrated in Figure 1.1. <BR><BR><A HREF="javascript:popUp('01.jpg')"><B>Figure 1.1.</B></A> <I>Typical monolithicapplication architecture.</I><H3><A NAME="Heading4"></A><FONT COLOR="#000077">The Revolution: Client/Server Architecture</FONT></H3><P>The advent of the PC made possible a dramatic paradigm shift from the monolithicarchitecture of mainframe-based applications. Whereas these applications requiredthe mainframe itself to perform all the processing, applications based on the client/serverarchitecture allowed some of that processing to be offloaded to PCs on the users'desktops.</P><P>Along with the client/server revolution came the proliferation of UNIX-based servers.Many applications simply did not require the massive power of mainframes, and becausethe client/server architecture was capable of moving much of the processing loadto the desktop PC, these smaller UNIX-based server machines were often more cost-effectivethan mainframes. Also, these machines were much more affordable to small businessesthan mainframes, which were often simply out of reach for companies with relativelysmall bank account balances. Still another benefit was the empowerment of individualdepartments within an organization to deploy and manage their own servers. The resultwas that these departments could be more responsive to their specific needs whendeveloping their own applications, rather than having to jump through proverbialhoops to get the department controlling the mainframes to develop applications, aswas often the case. Finally, whereas terminals were typically restricted to runningonly applications on the mainframe, a PC was capable of performing many other tasksindependently of the mainframe, further enhancing its usefulness as a desktop machine.</P><P>Client/server applications typically distributed the components of the applicationso that the database would reside on the server (whether a UNIX box or mainframe),the user interface would reside on the client, and the business logic would residein either, or both, components. When changes were made to parts of the client component,new copies of the client component (usually executables or a set of executables)had to be distributed to each user.</P><P>With the advent of multitier client/server architecture (discussed in the nextsection), the "original" client/server architecture is now referred toas "two-tier" client/server. The two-tier client/server architecture isillustrated in Figure 1.2. <BR><BR><A HREF="javascript:popUp('02.jpg')"><B>Figure 1.2.</B></A> <I>Two-tier client/serverarchitecture.</I><H3><A NAME="Heading5"></A><FONT COLOR="#000077">The Evolution: Multitier Client/Server</FONT></H3><P>The client/server architecture was in many ways a revolution from the old wayof doing things. Despite solving the problems with mainframe-based applications,however, client/server was not without faults of its own. For example, because databaseaccess functionality (such as embedded database queries) and business logic wereoften contained in the client component, any changes to the business logic, databaseaccess, or even the database itself, often required the deployment of a new clientcomponent to all the users of the application. Usually, such changes would breakearlier versions of the client component, resulting in a fragile application.</P><P>The problems with the traditional client/server (now often called "two-tier"client/server) were addressed by the multitier client/server architecture. Conceptually,an application can have any number of tiers, but the most popular multitier architectureis three-tier, which partitions the system into three logical tiers: the user interfacelayer, the business rules layer, and the database access layer. A three-tier client/serverarchitecture is illustrated in Figure 1.3. <BR><BR><A HREF="javascript:popUp('03.jpg')"><B>Figure 1.3.</B></A> <I>Three-tier client/serverarchitecture.</I> <BR><BR>Multitier client/server architecture enhances the two-tier client/server architecture
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -