4
Editor: Wiley McKinzie, School of Computer Science and Technology, Rochester lnstitute of Technology, Rochester, NY 14623; Compmall, w.mckinzie; CSnet, wrm@rit Software Components with Ada: Structures, Tools, and Subsystems Grady Booch (Benjamin/Cum- mings Publishing Company, Inc., Menlo Park, Calif., 1987, 635 pp., $35.95) The philosopher's stone of software engineering, for which many have searched long and hard, is truly reusa- ble software: code that can be used without any change on many different projects. Search no more: Software Components With Ada demonstrates how to write truly reusable software using the Ada programming language. (For those who do not know Ada, an appendix provides enough of an intro- duction to understand the rest of the book.) Paraphrasing the author's preface, the book's four goals are to provide a catalog of reusable software compo- nents, to offer examples of good pro- gramming style using Ada, to expound an object-oriented software develop- ment technique, and to provide a study of data structures and algorithms. The book succeeds admirably in meeting the first two goals. It does not do as well on the last two. The book begins with an introduction to reusable software components, fol- lowed by an introduction to object- oriented software development, its role in the software life cycle, and its advan- tages over functional decomposition methods. Unfortunately, too little space is allotted to this intricate topic. Most of the material has been condensed from Booch's earlier book Software Engineering With Ada (Benjamin/ Cummings, 1987); those interested in object-oriented software development would do better to read that book. The bulk of the book focuses on data structures and algorithms. The author devotes one chapter to each of the tradi- This book demonstrates how to write truly reusable software using the Ada programming language. tional data structures: stacks, lists, strings, queues, rings, maps, sets, bags, trees, and graphs. Each data structure is described as an abstract data type; then the complete Ada code is given for several implementations of the abstract data type. Typically, one implementa- tion uses a dynamically linked represen- tation to provide an unbounded structure, and a second uses a static array repre- sentation to provide a bounded structute. The abstract data types are encapsulated as Ada generic packages that can be instantiated to create "a structure of anything," for example, a list of integers, a tree of student records (for fast searching), or a graph of network nodes (for communications network analysis). Examples of application pro- grams that instantiate and use each data structure are also given. The author then presents algorithms built on top of the bare abstract data types. Many of the traditional algorithms are covered, including list and tree insertion and deletion; internal and external sorting; array, list, tree, and graph searching; and pattern matching. Like the abstract data types, the sorting and searching algorithms take the form of Ada generic procedures that can be instantiated to work on any kind of data. The author also presents Ada implementations of a storage manager for collecting garbage, semaphores and monitors for synchronizing access to shared data structures among concur- rent tasks, and filters and pipes for building an application as a collection of tasks that have data flowing among them. Closing the book is a chapter on how to organize a large software system into a collection of subsystems, where each subsystem is a collection of Ada pack- ages. The final chapter covers the manhgerial, legal, and social issues in employing reusable software com- ponents. The Ada code is the book's best fea- ture; it alone is worth the price. The code is of high quality: in the thousands of lines that I read, I found only two slight errors. The code is immediately usable. One could type it in without any changes and instantly start using it on a real software project. (Incidentally, the book's copyright page states, "All of the software described in this book is available in machine-readable form from the author. ") The author has excellently demonstrated how to exploit Ada's capabilities to develop truly reus- able, portable software. The author has also provided many practical examples of good Ada coding style and of how to COMPUTER 140

Software Components withAda: Structures, Tools, and … · Algorithms(A. Aho,J. Hopcroft, and J. Ullman,Addison-Wesley, 1983), DataStructures UsingPascal(A. TenenbaumandM.Augenstein,

Embed Size (px)

Citation preview

Editor: Wiley McKinzie, School of Computer Science and Technology, Rochester lnstitute of Technology, Rochester, NY 14623; Compmall, w.mckinzie; CSnet, wrm@rit

Software Components with Ada: Structures, Tools, and Subsystems

Grady Booch (Benjamin/Cum-mings Publishing Company, Inc.,Menlo Park, Calif., 1987, 635 pp.,$35.95)

The philosopher's stone of softwareengineering, for which many havesearched long and hard, is truly reusa-ble software: code that can be usedwithout any change on many differentprojects. Search no more: SoftwareComponents With Ada demonstrateshow to write truly reusable softwareusing the Ada programming language.(For those who do not know Ada, anappendix provides enough of an intro-duction to understand the rest of thebook.)

Paraphrasing the author's preface,the book's four goals are to provide acatalog of reusable software compo-nents, to offer examples of good pro-gramming style using Ada, to expoundan object-oriented software develop-ment technique, and to provide a studyof data structures and algorithms. Thebook succeeds admirably in meeting thefirst two goals. It does not do as well onthe last two.The book begins with an introduction

to reusable software components, fol-lowed by an introduction to object-oriented software development, its rolein the software life cycle, and its advan-tages over functional decompositionmethods. Unfortunately, too little spaceis allotted to this intricate topic. Mostof the material has been condensed

from Booch's earlier book SoftwareEngineering With Ada (Benjamin/Cummings, 1987); those interested inobject-oriented software developmentwould do better to read that book.The bulk of the book focuses on data

structures and algorithms. The authordevotes one chapter to each of the tradi-

This book demonstrateshow to write truly

reusable software usingthe Ada programming

language.

tional data structures: stacks, lists,strings, queues, rings, maps, sets, bags,trees, and graphs. Each data structure isdescribed as an abstract data type; thenthe complete Ada code is given forseveral implementations of the abstractdata type. Typically, one implementa-tion uses a dynamically linked represen-tation to provide an unbounded structure,and a second uses a static array repre-sentation to provide a bounded structute.The abstract data types are encapsulatedas Ada generic packages that can beinstantiated to create "a structure ofanything," for example, a list of

integers, a tree of student records (forfast searching), or a graph of networknodes (for communications networkanalysis). Examples of application pro-grams that instantiate and use each datastructure are also given.

The author then presents algorithmsbuilt on top of the bare abstract datatypes. Many ofthe traditional algorithmsare covered, including list and treeinsertion and deletion; internal andexternal sorting; array, list, tree, andgraph searching; and pattern matching.Like the abstract data types, the sortingand searching algorithms take the formof Ada generic procedures that can beinstantiated to work on any kind ofdata. The author also presents Adaimplementations of a storage managerfor collecting garbage, semaphores andmonitors for synchronizing access toshared data structures among concur-rent tasks, and filters and pipes forbuilding an application as a collectionof tasks that have data flowing amongthem.

Closing the book is a chapter on howto organize a large software system intoa collection of subsystems, where eachsubsystem is a collection of Ada pack-ages. The final chapter covers themanhgerial, legal, and social issues inemploying reusable software com-ponents.The Ada code is the book's best fea-

ture; it alone is worth the price. Thecode is of high quality: in the thousandsof lines that I read, I found only twoslight errors. The code is immediatelyusable. One could type it in without anychanges and instantly start using it on areal software project. (Incidentally, thebook's copyright page states, "All ofthe software described in this book isavailable in machine-readable formfrom the author. ") The author hasexcellently demonstrated how to exploitAda's capabilities to develop truly reus-able, portable software. The author hasalso provided many practical examplesof good Ada coding style and of how to

COMPUTER140

use Ada's more arcane features likepackages, generics, attributes, aggregates,exceptions, and array slices. The imple-mentations of filters and pipes are par-ticularly noteworthy. Using these, onecan take a software system described asa data flow diagram and map it directlyinto Ada code, with filters standing forprocesses and pipes standing for thedata flows connecting them.Compared to well-known data struc-

tures texts like Data Structures andAlgorithms (A. Aho, J. Hopcroft, andJ. Ullman, Addison-Wesley, 1983),Data Structures Using Pascal (A.Tenenbaum and M. Augenstein,Prentice-Hall, 1986), and Algorithms +Data Structures = Programs (N.Wirth, Prentice-Hall, 1976), this bookdoes not provide particularly goodexplanatory material. The author'sexplanations of how the data structuresand algorithms work are mostly toobrief and include too few pictures, espe-cially pictures of the algorithms inaction. Although examples of both iter-ative and recursive algorithms aregiven, the author does not devote spaceto studying the differences and tradeoffsbetween iteration and recursion. Whilethe author does introduce the "big-O"notation for expressing time and spacecomplexity and lists formulas for eachalgorithm's complexity, he does notdevote much space to showing how theformulas were derived. Some importantdata structures and algorithms-includingbinary tree search, balanced trees, B-trees, and tries-are just mentionedbriefly or are not covered at all. Thearea of storage management and garbagecollection is covered, but not to thesame depth as the texts mentioned above.Someone who has not already studieddata structures and algorithms shouldstudy this book in conjunction withanother data structures text.

Despite these shortcomings, everysoftware practitioner and studentshould get this book. Students will findit a valuable supplement to a data struc-tures and algorithms course, showingthem how to craft practical, reusablesoftware from the concepts they study.Students of Ada can also use it to findexamples of the language's features inuse. Practitioners can use the book as adata structures and algorithms referenceand a source for already-implementedAda code upon which they can buildtheir own applications. Even thoseworking in a language other than Adawill find in this book many importantlessons on how to build software that istruly reusable.

Alan KaminskyRochester Institute of Technology

The Art of Prolog: Advanced ProgrammingTechniquesLeon Sterling and Ehud Shapiro(MIT Press, Cambridge, Mass.,1986, 437 pp., $29.95)

This book is not, nor does it pretendto be, an introduction to Prolog. Designedas a text for first-year graduate studentsin computer science, the intent of theauthors is to present "advanced pro-gramming techniques that have evolvedin the Prolog community" and to showhow those techniques "can be combinedto build application programs. "

Part I, Chapters 1 through 5, is a self-contained introduction to logic pro-gramming. Topics include the basicconstructs of logic programs, databaseand recursive programming styles, andthe computational model of logic pro-gramming. Part II, Chapters 6 through13, contains valuable discussions of thepure Prolog computational model,system-defined predicates for enhancing

The chapters thatintroduce and illustrateadvanced techniques areworth the price of the

book.

the expressiveness of the model, andbasic declarative programming tech-niques. In Part III, Chapters 14 through19, advanced techniques are introducedand illustrated. These chapters, cover-ing nondeterminism, incomplete datastructures, definite clause grammars,second-order programming, and the useof meta-interpreters, are alone worththe price of the book. Larger applica-tions, built on materials developedearlier, are the subject of Part IV, Chap-ters 20 through 23. The authors providecomplete code for game-playing pro-grams illustrating the minimax algo-rithm with alphabeta pruning, aprototype expert system for evaluatingcredit applications, a symbolic equationsolver, and a compiler for a subset ofan Algol-type language. Each applica-tion is extensively annotated.

The Art ofProlog is professionallypackaged with few typos and an excel-lent index. Background sections andexercises accompany each chapter. Theauthors' style is generally adequate,although on occasion so compact as tobe all but unintelligible to the generalreader. Perhaps this is forgivable, given

the target audience. Example programs,written in Wisdom Prolog, are availableon disk from MIT Press for $15.95. AWisdom interpreter may be purchasedfor $95.00.What I particularly like about The

Art ofProlog is its uncompromisinginsistence on the declarative program-ming paradigm. On one level, this bookcan be viewed as a sustained and rigor-ous investigation of the relationshipbetween the logic programming com-putational model and Prolog, the mostsuccessful implementation of thatmodel to date. The assumption of theauthors, shared by many in the Prologcommunity, is that only by understand-ing that relationship can one hope toexploit the full potential of Prolog. In arecent issue ofAIExpert (June 1987),Fernando Pereira complained that"existing books tend to present Prologin the manner of a stand-up comedianflashing one clever feature after another."The Art ofProlog is a refreshing andtimely exception.

Kevin DonaghyRochester Institute of Technology

Using CADKEY

Paul J. Resetarits and Gary R.Bertoline (Delmar Publishers,Inc., Albany, N.Y., 1987, 326 pp.,$35.95)

CADKEY is a very popular 3Dmechanical CAD system (over 30,000copies sold at $2700 each) that I haveused and reviewed for IEEE Software(May 1987). Since I really like the soft-ware, I was looking forward to readingthe book. Both authors are knowledge-able, even experts, in the field, and oneof them (Resetarits) was instrumental indeveloping the CADKEY Users' Refer-ence Manual.The preface says that this is a text-

book for those learning to use the sys-tem, and can either be a classroom textor a supplement to the users' referencemanual. Included with the text are twowork disks.

Frankly, I was not too impressed.The book reads more like a referenceguide than anything else. Since theguide that comes with CADKEY ispretty good, this book should offersomething more than a rehash of the

November 1987 141

contents of the manual. Unfortunately,it doesn't.The book includes 17 chapters. The

first two describe CAD, CAM, andCIM (computer-integrated manufactur-ing). The third explains the CADKEY-human interface (which makes CAD-KEY so nice to use). The remainingchapters correspond to primary andsecondary menus in CADKEY.The book gives many examples, lots

of figures, and an explanation of thepossible uses of the CADKEY featurebeing discussed. Exercises at the end ofeach chapter include drawings foundwithin the chapter and on the workdisks. These exercises have you gothrough the steps outlined in the "Pos-sible Use of..." sections that are part ofeach chapter.

In most cases the exercises are veryhelpful. However, a particularly bad setof examples appears in Chapter 13,"Detailing Your Design." Here theauthors have given examples that don'twork because the example drawing hasbeen executed incorrectly or a typoinvalidates the command string given.Also, one of the examples is meaning-less (because the rescale doesn't makesense unless you know that the originalexample is not at a 1:1 scale). Andfinally, just when an example would behelpful (such as in the discussion oncross hatching), none is given. Whilethe astute user will be able to work outall the problems, the less astute user willjust get bogged down.My main complaint, however, con-

cerns the presentation. As a textbookwriter myself, I'm one who believes thata textbook should be conceptuallyorganized rather than simply list thefacts. The book ought to start with justthe basics: what you need to know toget you going. Then, it ought to usethese basics to enable the reader to cre-ate meaningful drawings, adding newfeatures of CADKEY as required. Inother words, the authors shouldn't tryto go through CADKEY using a top-down menu approach, but rather theyshould help the reader understand whattools are needed to develop a completedrawing.

While the book is easy to read, itdoesn't appear to offer much over thereference manual. I didn't find enoughnew material to justify purchasing thebook. Certainly the recitation of factsdoesn't particularly assist the reader inbecoming a (more) proficient CADKEYuser. Consequently, I didn't really findthis book overly helpful and I can'trecommend it.

Richard EckhouseMOCO, Inc.

Data Communications Networking Devices:Characteristics, Operation, Applications

Gilbert Held (John Wiley & Sons,Inc., New York, 1986, 360 pp.,$29.95)

Data communications networkingdevices are the building blocks uponwhich networks are constructed. Thestated goal of the author of Data Com-munications Networking Devices:Characteristics, Operation, Applica-tions is to provide the reader with an

The appendices cover two computerprograms for those readers actuallyinvolved in the sizing of networkdevices. After reading the appendicesand executing the computer programs,the reader can reduce many sizing prob-lems to a table lookup procedure.

This book is suitable for a one-semester course at a high-level under-graduate or a first-year graduate courselevel. Once again, a need has been ful-filled.

Chanden Sen

There has long been a

need for a book on thesedevices.

"intimate awareness of the numerousdevices which can be employed in thedesign, modification or optimization ofa data communications network." Inmy opinion, he has achieved this goaladmirably.

There has long been a need for abook on this subject. When I took acourse in data communications atNCSU in Spring 1985, the teacher hadto teach from his own notes compiledfrom various sources. The book underreview covers much of that course mate-rial and more.The book is designed to provide the

reader with a detailed understanding ofthe operation and utilization of commu-nications devices. It covers a lot ofground-from transmission techniquesto error detection and correction, frommodems to concentrators and front-endprocessors, from redundancy and relia-bility aids to automatic assistancedevices, and from speed and mode con-verters to inverse multiplexing withmultiport modems.The writing style is excellent. The

author strikes an intelligent balancebetween readability and scholarship.Specific topics are treated within a half-page or page to keep the size of thebook within acceptable limits. There arenumerous illustrations and schematicdiagrams. The review questions at theend of each chapter are good, and aninstrument manual is available from thepublisher.

I liked the depth of treatment of thesection on cyclic or polynomial code.However, I felt that the section on''protocol converters" could have beenlonger.

Knowledge Systems andProlog: A LogicalApproach to ExpertSystems and NaturalLanguage Processing

Adrian Walker (ed.), MichaelMcCord, John F. Sowa, andWalter G. Wilson (Addison-Wesley Publishing Company,Inc., Reading, Mass., 1987, 475pp., $30.95)

The authors of this book have setthemselves an ambitious task. Theyattempt to cover a wide range of sub-jects, including the Prolog language,expert systems, and natural languageprocessing, using logic as their centraltheme. In general, they do not succeedas well as could be hoped.The major flaw in the book is the

unevenness of the coverage, whichranges from introductory to advanced,and from general to highly detailed. Asthe authors themselves note, the bookhas "an unusual span of topics andlevels." However, the book has amodular organization, and readersinterested in only certain of the topicsare guided to the relevant sections.The book begins with a fairly low-

level introduction to knowledge systemsand Prolog, but introduces the unifyingtheme of logic in a clear fashion. It con-tinues with an introduction to IBM Pro-log and some advanced programmingmethods. The emphasis seems more on

COMPUTER142

logic than on the teaching of Prolog. Ifeel few could learn Prolog from thisdiscussion by itself, especially since itmakes no attempt to discuss any otherProlog implementation. There are someexercises, but no answers are suppliedfor those not done in the text.By the third chapter, a most welcome

section on style in writing Prolog pro-grams is presented and illustrated withseveral advanced examples. These areinteresting in themselves, but may bebeyond a person whose only knowledgeof Prolog comes from the introduction.

The authors attempt tocover a wide range ofsubjects, including theProlog language, expertsystems, and natural

language.

Expert systems are treated by verybriefly considering knowledge represen-tation, looking at two shells (one ofwhich uses confidence weights), andconsidering explanation and knowledgechecking. In these areas, both conceptsand their Prolog implementations arepresented.The book concludes with a discussion

of natural language processing in Pro-log. The authors start by introducing alogical form language, then theydevelop logic grammars, and finallythey consider syntactic constructs andsemantic interpretations. The discussionis detailed and interesting, and the finalexample, a natural language interface toa university course database, is cleverlychosen.The book also features appendices on

IBM Prolog usage and the logical basisfor the expert system shells.For an introduction to Prolog and

expert systems, either as a course text ora self-tutorial, this book is not the bestpossible choice. Better introductions areavailable (for example, Ivan Bratko'sProlog Programmingfor ArtificialIntelligence, Addison-Wesley, 1986).For an advanced treatment of selectedexpert systems topics or for a sophisti-cated discussion of natural languageprocessing, this book has much tooffer.

Walter A. WolfRochester Institute of Technology

Image processing. A Frost & Sullivanreport called The US Commercial Mar-ketfor Image Processing Systems (#A1771, 319 pp., $1950) explores themarket segments of image processing.The report forecasts total commercialmarket growth from $470.4 million in1986 to $532.3 million in 1987 and to $1billion by 1992. Specifically, artificialvision is predicted to reach 40 percentof the image processing market by 1992.The report The Analog-to-Digital and

Digital-to-Analog Conversion Compo-nents Market in the US (#A1781, 288pp., $1950) from Frost & Sullivancovers the products that make commu-nication possible between a computer ordigital chip and the non-numerical sig-nals in common use. The study predictsthat US industry will spend more than$1.4 billion a year by 1991 for equip-ment to translate the real world into adigital realm and back again. Thereport includes market segments, tech-nologies, and companies.Customer Service, Frost & Sullivan,

106 Fulton St., New York, NY 10038;(212) 233-1080 or Frost & Sullivan, Sul-livan House, 4 Grosvenor Gardens,London SWIW ODH; (01) 730-3438.

Process control. Using material fromHydrocarbon Processing magazine, edi-tor Les A. Kane put together the Hand-book ofAdvanced Process ControlSystems (ISBN 0-87201-721-4, 368 pp.,$55). The handbook is divided intothree major sections: instrumentationapplications, advanced and conven-tional control strategies, and advancedand conventional control aids. GulfPublishing Co., Book Div., Dept. R7,PO Box 2608, Houston, TX 77252. Add$6 each for shipping and handling.

Network for problem solving. TheTeltech Resource Network is an infor-mation service centered on a computer-ized network that sets up person-to-personcommunications between client compa-nies and engineers and scientists fromuniversities, national laboratories, andprivate industry throughout the US.The network offers expert consultationin over 1400 scientific areas. The servicepackage comes with PC-compatible,

custom-designed software. Users enter atopic and receive the names of scientistsin that area who will field questions. Ayearly charge based on client needsallows unlimited access. The chargeranges from $3000 to $10,500. The net-work also includes an interactive litera-ture search capability. Contact RonHelgeson, Corporate Communications,Teltech Corp., 9855 W. 78th St., Min-neapolis, MN 55344; (612) 829-9000.

MAP Product Guide introduces con-siderations in planning and implement-ing a Manufacturing AutomationProtocol network; describes productsand product lines; and lists block dia-grams, pricing, and references. Theguide costs $175 ($215 outside the US)and is available from ArchitectureTechnology Corp., PO Box 24344,Minneapolis, MN 55424; (612)935-2035.

Video & Graphics Presentation Systems(200 pp., $995) considers a range oftechnologies, software, and subsystemsthat permit the manufacture of micro-computer- or workstation-based presen-tation development systems withcapabilities for color, animation, video,sound, and so forth. The report concen-trates on integrated systems with a cur-rent or expected price range of up to$100,000. Primary analysis targets USbusiness applications, but governmentand education markets are also included.International Planning Information,465 Convention Way, #1, RedwoodCity, CA 94063; (415) 364-9040.

Productivity Resource Guide is offeredfree of charge by the Institute of Indus-trial Engineers. Its avowed purpose is toassist people in industry and businesswho wish to improve their productivityso as to better compete in the worldtrade market. The guide covers IIEproducts and services geared towardproductivity improvement. It also pro-vides an alphabetical listing of some USand international productivity centersand related organizations. IIE, 25 Tech-nology Park/Atlanta, Norcross, GA30092; (404) 449-0460.

November 1987

T

143