OBJECT-ORIENTED ANALYSIS AND DESIGN

3y ago
101 Views
19 Downloads
2.85 MB
543 Pages
Last View : 10d ago
Last Download : 3m ago
Upload by : Jewel Payne
Transcription

OBJECT-ORIENTEDANALYSIS AND DESIGNWith applicationsSECOND EDITIONGrady BoochRationalSanta Clara, CaliforniaADDISON-WESLEY

PrefaceTo JanMy friend, my lover, my wifeSponsoring Editor: Dan JoraanstadEditorial Assistant: Melissa StandenCopy Editor: Nicholas MurrayCover Designer: Yvo Riezebos DesignProduction Editor: Wendy EarlCartoonist: Tony HallProofreader: Eleanor Renner BrownDesign Consultant: David Granville HealyAdobe illustrator is a trademark of Adobe Systems, Inc.Apple, Macintosh, and MacApp are trademarks of Apple Computer, Inc.Booch Components is a trademark of Grady Booch.Eiffel is a trademark of Interactive Software Engineering, Inc.Mathematica is a trademark of Wolfram Research, Inc.Motif is a trademark of Open Software Foundation, Inc.Objective-C is a trademark of Stepstone.Objectworks and Smalltalk-80 are trademarks of ParcPlace Systems.OS/2 is a trademarks of International Business Machines.Pure Software is a trademarks of Pure Software, Inc.Rational and Rational Rose are trademarks of Rational.Simula 67 is a trademark of Simula AS.UNIX is a trademark of AT&T Technologies, Inc.Windows and Word are trademarks of Microsoft Inc.Camera-ready copy for this book was prepared on a Macintosh with Microsoft Word andAdobe Illustrator. All C examples were developed using tools from Apple Computer,AT&T, Borland International, Centerline, Pure Software, and Sun Microsystems.The notation and process described in this book is in the public domain, and its use by all isencouraged (but please acknowledge its source).Copyright 1994 by Addison Wesley Longman, Inc.All rights reserved. No part of this publication may be reproduced, stored in a retrievalsystem, or transmitted, in any form or by any means, electronic, mechanical, photocopying,recording, or otherwise, without the prior written permission of the publisher. Printed in theUnited States of America. Published simultaneously in Canada.Library of Congress Cataloging-in-Publication DataBooch, Grady.Object-oriented analysis and design with applications / Grady Booch. 2nd ed.ISBN 0-8053-5340-215 1617181920 DOC 0 1 00 99 98l5th Printing December 1998

PREFACEMankind, under the grace of God, hungers for spiritual peace,esthetic achievements, family security, justice, and liberty,none directly satisfied by industrial productivity. But productivityallows the sharing of the plentiful rather than fighting overscarcity; it provides time for spiritual, esthetic, and familymatters. It allows society to delegate special skills toinstitutions of religion, justice, and the preservation of liberty.HARLAN MILLSDPMA and Human ProductivityAs computer professionals, we strive to build system that are useful and that work; assoftware engineers, we are faced with the task of creating complex system in the presence ofscarce computing and human resource. Over the past few years, object-oriented technologyhas evolved in diverse segments of the computer sciences as a means of managing thecomplexity inherent in many different kinds of systems. The object model has proven to be avery powerful and unifying concept.Changes to the First EditionSince the publication of the first edition of Object-Oriented Design with Applications, objectoriented technology has indeed moved into the mainstream of industrial-strength softwaredevelopment. We have encountered the use of the object-oriented paradigm throughout theworld, for such diverse domains as the administration of banking transactions; theautomation of bowling alleys; the management of public utilities; and the mapping of thehuman genome. Many of the next generation operating systems, database systems, telephonysystems, avionics systems, and multimedia applications are being written usingobject-oriented techniques. Indeed, many such projects have chosen to use object-orientedtechnology simply because there appears to be no other way to economically produce anenduring and resilient programming system.Over the past several years, hundreds of projects have applied the notation and processdescribed in Object-Oriented Design with Applications1. Through our own work with several ofIncluding my own projects. Ultimately, I’m a developer, not just a methodologist. The first question you shouldask any methodologist is if he or she uses their own methods to develop software1

Preface ivthese projects, as well as the kind contribution of many individuals who have taken the timeto communicate with us, we have found ways to improve our method, in terms of betterarticulating the process, adding and clarifying certain semantics otherwise missing or difficultto express in the notation, and simplifying the notation where possible.During this time, many other methods have also appeared, including the work of Jacobson,Rumbaugh, Coad and Yourdon, Constantine, Shlaer and Mellor, Martin and Odell,Wasserman, Goldberg and Rubin, Embley, WirfsBrock, Goldstein and Alger, HendersonSellers, Firesmith, and others. Rumbaugh's work is particularly interesting, for as he pointsout, our methods are more similar than they are different. We have surveyed many of thesemethods, interviewed developers and managers who have applied them, and where possible,tried these methods ourselves. Because we are more interested in helping projects succeedwith object-oriented technology rather than dogmatically hanging on to practices solely foremotional or historical reasons, we have tried to incorporate the best from each of thesemethods in our own work. We gratefully acknowledge the fundamental and uniquecontributions each of these people has made to the field.It is in the best interests of the software development industry, and object oriented technologyin particular, that there be standard notations for development. Therefore, this editionpresents a unified notation that, where possible, eliminates the cosmetic differences betweenour notation and that of others, particularly Jacobson's and Rumbaugh's. As before, and toencourage the unrestricted use of the method, this notation is in the public domain.The goals, audience, and structure of this edition remain the same as for the first edition.However, there are five major differences between this edition and the original publication.First, Chapter 5 has been expanded to provide much more specific detail about the unifiednotation. To enhance the reader's understanding of this notation, we explicitly distinguishbetween its fundamental and advanced elements. In addition, we have given special attentionto how the various views of the notation integrate with one another.Second, Chapters 6 and 7, dealing with the process and pragmatics of object-oriented analysisand design, have been greatly expanded. We have also changed the title of this second editionto reflect the fact that our process does indeed encompass analysis as well as design.Third, we have chosen to express all programming examples in the main text using C . Thislanguage is rapidly becoming the de facto standard in many application domains;additionally, most professional developers who are versed in other object-orientedprogramming languages can read C . This is not to say that we view other languages - suchas Smalltalk, CLOS, Ada, or Eiffel - as less important. The focus of this book is on analysis anddesign, and because we need to express concrete examples, we choose to do so in areasonably common programming language. Where applicable, we describe the semanticsunique to these other languages and their impact upon the method,

Preface vFourth, this edition introduces several new application examples. Certain idioms andarchitectural frameworks have emerged in various application domains, and these examplestake advantage of these practices. For example, client/server computing provides the basis ofa revised application example.Finally, almost every chapter provides references to and discussion of the relevant objectoriented technology that has appeared since the first edition.GoalsThis book provides practical guidance on the construction of object-oriented systems. Itsspecific goals are: To provide a sound understanding of the fundamental concepts of the object modelTo facilitate a mastery of the notation and process of object-oriented analysis anddesignTo teach the realistic application of object-oriented development within a variety ofproblem domainsThe concepts presented herein all stand on a solid theoretical foundation, but this is primarilya pragmatic book that addresses the practical needs and concerns of the software engineeringcommunity.AudienceThis book is written for the computer professional as well as for the student. For the practicing software engineer, we show you how to effectively use objectoriented technology to solve real problems. In your role as an analyst or architect, we offer you a path from requirements toimplementation, using object-oriented analysis and design. We develop your ability todistinguish "good” object-oriented architectures from "bad" ones, and to trade offalternate designs when the perversity of the real world intrudes. Perhaps mostimportant, we offer you fresh approaches to reasoning about complex systems. For the program manager, we provide insight on how to allocate the resources of ateam of developers, and on how to manage the risks associated with complex softwaresystems. For the tool builder and the tool user, we provide a rigorous treatment of the notationand process of object-oriented development as a basis for computer-aided softwareengineering (CASE) tools. For the student, we provide the instruction necessary for you to begin acquiringseveral important skills in the science and art of developing complex systems.

Preface viThis book is also suitable for use in undergraduate and graduate courses as well as inprofessional seminars and individual study. Because it deals primarily with a method ofsoftware development, it is most appropriate for courses in software engineering andadvanced programming, and as a supplement to courses involving specific object-orientedprogramming languages.StructureThe book is divided into three major sections - Concepts, The Method, and Applications withconsiderable supplemental material woven throughout.ConceptsThe first section examines the inherent complexity of software and the ways in whichcomplexity manifests itself. We present the object model as a means of helping us managethis complexity. In detail, we examine the fundamental elements of the object model:abstraction, encapsulation, modularity, hierarchy, typing, concurrency, and persistence. Weaddress basic questions such as "What is a class?" and "What is an object?" Because theidentification of meaningful classes and objects is the key task in object-orienteddevelopment, we spend considerable time studying the nature of classification. In particular,we examine approaches to classification in other disciplines, such as biology, linguistics, andpsychology, then apply these lessons to the problem of discovering classes and objects insoftware systems.The MethodThe second section presents a method for the development of complex systems based on theobject model. We first present a graphic notation for object-oriented analysis and design,followed by its process. We also examine the pragmatics of object-oriented development - inparticular, its place in the software development life cycle and its implications for projectmanagement.ApplicationsThe final section offers a collection of five complete, nontrivial examples encompassing adiverse selection of problem domains: data acquisition, application frameworks, client/serverinformation management, artificial intelligence, and command and control. We have chosenthese particular problem domains because they are representative of the kinds of complexproblems faced by the practicing software engineer. It is easy to show how certain principlesapply to simple problems, but because our focus is on building useful systems for the realworld, we are more interested in showing how the object model scales up to complexapplications. Some readers may be unfamiliar with the problem domains chosen, so we begineach application with a brief discussion of the fundamental technology involved (such asdatabase design and blackboard system architecture). The development of software systems

Preface viiis rarely amenable to cookbook approaches; therefore, we emphasize the incrementaldevelopment of applications, guided by a number of sound principles and well-formedmodels.Supplemental MaterialA considerable amount of supplemental material is woven throughout the book. Mostchapters have boxes that provide information on important topics, such as the mechanics ofmethod dispatch in different object-oriented programming languages. We also include anappendix on object-oriented programming languages, in which we consider the distinctionbetween object-based and object-oriented programming languages and the evolution andessential properties of both categories of languages. For those readers who are unfamiliarwith certain object-oriented programming languages, we provide a summary of the featuresof a few common languages, with examples. We also provide a glossary of common termsand an extensive classified bibliography that provides references to source material on theobject model. Lastly, the end pages provide a summary of the notation and process of theobject-oriented development method.Available apart from the text, and new to the second edition, is an Instructor's Guidecontaining suggested exercises, discussion questions, and projects, which should prove veryuseful in the classroom. The Instructor’s Guide with Exercises (ISBN 0-8053-534PO) has beendeveloped by Mary Beth Rosson from IBM's Thomas J. Watson laboratory. Qualifiedinstructors may receive a free copy from their local sales representatives or by emailingaw.cse@aw.com. Questions, suggestions, and contributions to the Instructor's Guide may beemailed to rosson@watson.ibm.com.Tools and training that support the Booch method are available from a variety of sources. Forfurther information, contact Rational at any of the numbers listed on the last page of thisbook. Additionally, Addison-Wesley can provide educational users with software thatsupports this notation.Using this BookThis book may be read from cover to cover or it may be used in less structured ways. If youare seeking a deep understanding of the underlying concepts of the object model or themotivation for the principles of object-oriented development, you should start with Chapter 1and continue forward in order. If you are primarily interested in learning the details of thenotation and process of object-oriented analysis and design, start with Chapters 5 and 6;Chapter 7 is especially useful to managers of projects using this method. If you are mostinterested in the practical application of object-oriented technology to a specific problemdomain, select any or all of Chapters 8 through 12.

Preface viiiAcknowledgmentsThis book is dedicated to my wife, Jan, for her loving support.Through both the first and second editions, a number of individuals have shaped my ideas onobject-oriented development. For their contributions, I especially thank Sam Adams, MilceAlcroid, Glenn Andert, Sid Bailin, Kent Beck, Daniel Bobrow, Dick BoIz, Dave Bulman, DaveBernstein, Kayvan Carun, Dave Collins, Steve Cook, Damian Conway, Jim Coplien, Brad Cox,Ward Cunningham, Tom DeMarco, Milce DevIin, Richard Gabriel, William Genemaras,Adele GolcIberg, Ian Graham, Tony Hoare, Jon Hopkins, Michael Jackson, Ralph Johnson,James Kempf, Norm Kerth, Jordan Kreindler, Doug Lea, Phil Levy, Barbara Liskov, CliffLongman, james MacFarlane, Masoud Milani, Harlan Mills, Robert Murray, Steve Neis, GeneOuye, Dave Parnas, Bill RicIdel, Mary Beth Rosson, Kenny Rubin, Jim Rumbaugh, KurtSchmucker, Ed Seidewitz, Dan Shiffman, Dave Stevenson, Bjarne Stroustrup, Dave Thomas,Milce Vilot, Tony Wasserman, Peter Wegner, Iseult White, john Williams, Lloyd Williams,Mario Wolczko, Nildaus Wirth, and Ed Yourdon.A large part of the pragmatics of this book derives from my involvement with complexsoftware systems being developed around the world at companies such as Apple, Alcatel,Andersen Consulting, AT&T, Autotrol, Bell Northern Research, Boeing, Borland, ComputerSciences Corporation, Contel, Ericsson, Ferranti, General Electric, GTE, Holland Signaal,Hughes Aircraft Company, IBM, Lockheed, Martin Marietta, Motorola, NTT, Philips,RockweIl International, Shell Oil, Symantec, Taligent, and TRW. I have had the opportunityto interact with literally hundreds of professional software engineers and their managers, andI thank them all for their help in making this book relevant to real-world problems.A special acknowledgment goes to Rational for their support of my work. Thanks also to myeditor, Dan Joraanstad, for his encouragement during this project, and to Tony Hall, whosecartoons brighten what would otherwise be just another stuffy technical book. Finally, thanksto my three cats, Camy, Annie, and Shadow, who kept me company on many a late night ofwriting.

ABOUT THE AUTORGrady Booch, Chief Scientist at Rational Software Corporation, isrecognized throughout the international software developmentcommunity for his pioneering work in object methods and applications.He is a featured columnist in Object Magazine and C Report, andthe author of several best-selling books on software engineering andobject-oriented development.Grady Booch also edits and contributes to the Object-OrientedSoftware Engineering Series published by Addison-Wesley.

ABOUT THE AUTORCONCEPTSSir Isaac Newton secretly admitted to some friends: Heunderstood how gravity behaved, but not how it worked!LILY TOMLINThe Search for Signs of Intelligent Life in the Universe

CHAPTER IComplexityA physician, a civil engineer, and a computer scientist were arguing about what was theoldest profession in the world. The physician remarked, "Weil, in the Bible, it says that Godcreated Eve from a rib taken out of Adam. This clearly required surgery, and so I can rightlyclaim that mine is the oldest profession in the world." The civil engineer interrupted, and said,"But even earlier in the book of Genesis, it states that God created the order of the heavensand the earth from out of the chaos. This was the first and certainly the most spectacularapplication of civil engineering. Therefore, fair doctor, you are wrong: mine is the oldestprofession in the world." The computer scientist leaned back in her chair, smiled, and thensaid confidently, "Ah, but who do you think created the chaos?"1.1 The Inherent Complexity of SoftwareThe Properties of Simple and Complex Software SystemsA dying star on the verge of collapse, a child learning how to read, white blood cells rushingto attack a virus: these are but a few of the objects in the physical world that involve trulyawesome complexity. Software may also involve elements of great complexity; however, thecomplexity we find here is of a fundamentally different kind. As Brooks points out, "Einsteinargued that there must be simplified explanations of nature, because God is not capricious orarbitrary. No such faith comforts the software engineer. Much of the complexity that he mustmaster is arbitrary complexity" [1].We do realize that some software systems are not complex. These are the largely forgettableapplications that are specified, constructed, maintained, and used by the same person,usually the amateur programmer or the professional developer working in isolation. This isnot to say that all such systems are crude and inelegant, nor do we mean to belittle theircreators. Such systems tend to have a very limited purpose and a very short life span. We canafford to throw them away and replace them with entirely new software rather than attemptto reuse them, repair them, or extend their functionality, Such applications are generally moretedious than dif

method dispatch in different object-oriented programming languages. We also include an appendix on object-oriented programming languages, in which we consider the distinction between object-based and object-oriented programming languages and the evolution and notation and process of object-oriented analysis and design, start with Chapters 5 and 6;

Related Documents:

Object Class: Independent Protection Layer Object: Safety Instrumented Function SIF-101 Compressor S/D Object: SIF-129 Tower feed S/D Event Data Diagnostics Bypasses Failures Incidences Activations Object Oriented - Functional Safety Object: PSV-134 Tower Object: LT-101 Object Class: Device Object: XS-145 Object: XV-137 Object: PSV-134 Object .

as object–oriented design. Object–oriented development approaches are best suited to projects that will imply systems using emerging object technologies to construct, manage, and assemble those objects into useful computer applications. Object oriented design is the continuation of object-oriented analysis,

Object oriented design methods emerged in the 1980s, and object oriented analysis methods emerged during the 1990s. In the early stage, object orientation was largely . and extensible system. Whole object oriented modeling is covered by using three kinds of models for a system description. These models are: object model,

Reusability, CK Metric, Object - Oriented. 1. INTRODUCTION Object oriented systems continue to share a major portion of software development and customer base for these systems is on the rise. This is because there are many advantages in taking the object oriented concept. The weakness though is that most object oriented systems tend to be .

An Object-Oriented Analysis and Design course provides practical guidance on the construction of object-oriented systems. Specifically, you will gain a solid footing in the Software Development Life Cycle (SDLC), and a mastery of object-oriented analysis and design. We will also cover the Unified Modeling

object-oriented programming language is based on a kind of old object-oriented programming language. For example, though C language is an object-oriented programming language, it still retains the pointer which is complex but has strong function. But C# improved this problem. C# is a kind of pure object-oriented language.

Object built-in type, 9 Object constructor, 32 Object.create() method, 70 Object.defineProperties() method, 43–44 Object.defineProperty() method, 39–41, 52 Object.freeze() method, 47, 61 Object.getOwnPropertyDescriptor() method, 44 Object.getPrototypeOf() method, 55 Object.isExtensible() method, 45, 46 Object.isFrozen() method, 47 Object.isSealed() method, 46

FSA ELA Reading Practice Test Questions Now answer Numbers 1 through 6. Base your answers on the passages “from The Metamorphoses” and “from Romeo and Juliet.” 1. Fill in a circle before two phrases Ovid uses in Passage 1 to show that Pyramus and Thisbe experience a shared love. “A A thing which they could not forbid, B they were both inflamed, with minds equally captivated. C There .