⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch05.htm

📁 corba比较入门级的介绍详细间接了corba访问发布各种细节。
💻 HTM
📖 第 1 页 / 共 4 页
字号:
<!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 5 -- Designing the System: A Crash Course in Object-Oriented Analysis and Design</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="../ch04/ch04.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch06/ch06.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 5<BR>Designing the System: A Crash Course in Object-Oriented Analysis and Design</FONT><AHREF="#Heading1"></A></H1></CENTER><UL>	<LI><A HREF="#Heading1">What Is Object-Oriented Analysis and Design?</A>	<LI><A HREF="#Heading2">Introducing the Unified Modeling Language (UML)</A>	<UL>		<LI><A HREF="#Heading3">History</A>		<LI><A HREF="#Heading4">Terminology and Symbols</A>		<LI><A HREF="#Heading5">Basic Methodology</A>		<LI><A HREF="#Heading6">UML Summary</A>	</UL>	<LI><A HREF="#Heading7">The Bank Example</A>	<UL>		<LI><A HREF="#Heading8">Defining System Requirements and Capabilities</A>		<LI><A HREF="#Heading9">Defining System Objects</A>		<LI><A HREF="#Heading10">Creating an Application Class Diagram</A>		<LI><A HREF="#Heading11">For Further Study...</A>	</UL>	<LI><A HREF="#Heading12">Summary</A>	<UL>		<LI><A HREF="#Heading13">What Comes Next?</A>	</UL>	<LI><A HREF="#Heading14">Q&amp;A</A>	<LI><A HREF="#Heading15">Workshop</A>	<UL>		<LI><A HREF="#Heading16">Quiz</A>		<LI><A HREF="#Heading17">Exercise</A>	</UL></UL><P><HR SIZE="4"><CENTER><H1><FONT COLOR="#000077"></FONT></H1></CENTER><P>With a knowledge of CORBA basics--such as the concept of the Object Request Broker(ORB) and the Interface Definition Language (IDL)--along with an understanding ofthe IDL language, you are ready to develop and deploy CORBA-based applications. You'vealready gained firsthand experience implementing a simple CORBA server and client.Now you'll design, implement, and enhance a more sophisticated CORBA application.To help you see what's ahead, the following road map is provided:<UL>	<LI>Today you'll design the sample system, a scaled-down banking application. Because	CORBA is an object-oriented architecture, this chapter will introduce you to object-oriented	analysis and design concepts while working through the design of the system.<BR>	<BR>		<LI>On Day 6, you'll map the system design into an IDL specification. You'll see	how system objects map to IDL classes, how partitions map to IDL modules, and other	aspects of the interface definition process. You'll also consider various CORBAservices	and CORBAfacilities to see how they might fit into your system design. You'll then	implement the basic capabilities of the banking application. You'll use the IDL definitions	you created as a starting point, from which you'll write separate implementations	for the server and client.<BR>	<BR>		<LI>On Day 7, you'll extend the basic capabilities of the application to include	exception handling. Exception handling provides error-checking capability, making	the application implementation more robust. Changes to the application begin in the	IDL code and then propagate through the implementation code.<BR>	<BR>		<LI>On Day 8, the application will gain complexity as you add another CORBA client	to the mix: the Automated Teller Machine (ATM) client. CORBA applications usually	include more than one client component, so this chapter gives you some exposure to	managing multiple clients in a CORBA application.<BR>	<BR>		<LI>On Day 9, you'll wrap up the banking application example with one final enhancement:	the capability to &quot;push&quot; update information from the server to the client(s),	using client callbacks.</UL><H2><A NAME="Heading1"></A><FONT COLOR="#000077">What Is Object-Oriented Analysisand Design?</FONT></H2><P>Although object-oriented technologies have existed for quite some time, the phrase&quot;object-oriented&quot; has gained much popularity (along with buzzword status)in recent years. Indeed, the phrase is often bandied about with reckless abandon,which serves to obscure its real meaning. To further confuse matters, it is usedto describe everything from development environments to programming languages todatabases.</P><P>So what does the term <I>object-oriented</I> really mean? The term seems to bethrown about indescriminately; anything from programming languages to drawing toolsmight be labeled as &quot;object-oriented.&quot; For the purposes of this book, youwill be interested primarily in three uses of object-oriented methodology: object-orientedanalysis (OOA), which deals with the design requirements and overall architectureof a system; object-oriented design (OOD), which translates a system architectureinto programming constructs (such as interfaces, classes, and method descriptions);and object-oriented programming (OOP), which implements these programming constructs.So, for your purposes, <I>object-oriented</I> can be taken to mean the various methodologies,described briefly herein, used to design and implement software. This chapter dealsprimarily with object-oriented analysis. On Day 6 you'll work with object-orienteddesign; when implementing system functionality, you'll be using object-oriented programmingtechniques.</P><P>Although this book introduces you to object-oriented analysis, design, and programmingconcepts, it does not attempt to cover these topics in detail. A number of booksalready written on these subjects provide a definitive introduction to and explanationof these concepts. Time spent familiarizing yourself with these concepts would betime well spent.<H2><A NAME="Heading2"></A><FONT COLOR="#000077">Introducing the Unified ModelingLanguage (UML)</FONT></H2><P>The Unified Modeling Language (UML) is a powerful tool for expressing object-orienteddesigns. Developed by Rational Software Corporation, UML is an evolution of previousmodeling languages and techniques. A description of UML, along with a set of linksto UML-related resources, appears on Rational's Web site at <TT>http://www.rational.com/uml/index.html</TT>.<H3><A NAME="Heading3"></A><FONT COLOR="#000077">History</FONT></H3><P>UML is an evolution of previous modeling languages and techniques. Prior to UML,many object-oriented methodologies existed. Of these, the three major methodologiesincluded Grady Booch's Booch 1993 method, Jim Rumbaugh's Object Modeling Technique(OMT) method, and Ivar Jacobson's Object-Oriented Software Engineering (OOSE) method.In October 1994, Booch and Rumbaugh joined forces to unify their methods, resultingin what was called the Unified Method 0.8 in October 1995. Around that time theywere joined by Jacobson, merging the OOSE method with Booch and Rumbaugh's work toform UML 0.9 in June 1996. The UML Partners consortium--consisting of companies suchas Digital, Hewlett-Packard, IBM, Microsoft, Oracle, Rational, and Unisys--was thenformed to refine UML even further, resulting in UML 1.0 in January 1997. The UML1.0 documents were submitted for standardization to the Object Management Group (OMG)--theorganization responsible for the specification of CORBA standards.<H3><A NAME="Heading4"></A><FONT COLOR="#000077">Terminology and Symbols</FONT></H3><P>The Unified Modeling Language is a highly visual language; in addition to wordsand text, it also consists (and in fact primarily consists) of graphs and symbols.Perhaps one of the most important diagrams you will encounter in object-orientedanalysis and design is the class diagram, which in turn consists of notations forclasses, associations, and inheritance (among other things, but these are the threeaspects you'll study here).<H4><FONT COLOR="#000077">The Class Diagram</FONT></H4><P>One important element of the Unified Modeling Language (or any modeling language,for that matter) is the <I>class diagram.</I> The class diagram, sometimes called(incorrectly) an object diagram or object model, describes classes and their relationshipsto other classes in the system. The class diagram specifies only static relationships--howclasses are related to each other--and not dynamic relationships, such as when objectsare created or invoke services of other objects.</P><P><B>New Term: </B>A <I>class diagram</I> graphically depicts the relationshipsbetween classes in a system. Depending on the level of the diagram's scope, it mayalso describe the attributes and operations provided by each class.</P><P>The class diagram is one of the most important elements of an object-orientedmethodology. It is essential to the understanding of a complex system architectureand provides a great deal of insight into a system design.<H4><FONT COLOR="#000077">Classes</FONT></H4><P>Naturally, the existence of the class diagram implies the existence of the class.As you might expect, the class in UML is analogous to a class in an object-orientedprogramming language such as Java or C++. A class has a name, zero or more attributes,and zero or more operations. Think of attributes as member data and operations asmember functions or methods. In a class diagram, a class description can take onone of the forms shown in Figure 5.1. <BR><BR><A HREF="javascript:popUp('01.jpg')"><B>Figure 5.1.</B></A> <I>UML class descriptions.</I><BR><BR>Figure 5.1 depicts three examples for the representation of a class. In the firstexample, only the class name is visible. This form is suitable for a class diagramthat focuses primarily on the relationships between classes. For example, an extremelycomplex class diagram benefits from this type of simplification, especially if thediagram is only to be used to provide an overview of an entire system. The secondexample shows the class name, its attributes, and its operations, but attributesand operations are listed by name only--types and parameters are omitted. The thirdexample shows a fully embellished class description, with class name, attributesand their types, and operations with their parameters and return types. These typesof class descriptions are useful when detailed information about a system and itsclasses is required.</P><P>A class description can also provide visibility modifiers for its attributes andoperations. The visibility modifier, which is optional, immediately precedes theattribute or operation that it describes. (When no visibility modifier is given,the attribute or method is usually assumed to be public.) A description of each ofthese modifiers appears in Table 5.1.<H4><FONT COLOR="#000077">Table 5.1&#160;&#160;UML Visibility Modifiers.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><B>Symbol</B></TD>		<TD ALIGN="LEFT"><B>Description</B></TD>		<TD ALIGN="LEFT"><B>Meaning</B></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><TT>+</TT></TD>		<TD ALIGN="LEFT">Public attribute/operation</TD>		<TD ALIGN="LEFT">Public attributes and operations of a class are available to that class and to any			other class.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><TT>#</TT></TD>		<TD ALIGN="LEFT">Protected attribute/operation</TD>		<TD ALIGN="LEFT">Protected attributes and operations of a class are available only to that class and			its subclasses.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><TT>-</TT></TD>		<TD ALIGN="LEFT">Private attribute/operation</TD>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -