Home > Store

Large-Scale C++ Software Design

Register your product to gain access to bonus material or receive a coupon.

Large-Scale C++ Software Design

Book

  • Your Price: $59.99
  • List Price: $74.99
  • Usually ships in 24 hours.

Description

  • Copyright 1997
  • Dimensions: 7-3/8" x 9-1/4"
  • Pages: 896
  • Edition: 1st
  • Book
  • ISBN-10: 0-201-63362-0
  • ISBN-13: 978-0-201-63362-7

Developing a large-scale software system in C++ requires more than just a sound understanding of the logical design issues covered in most books on C++ programming. To be successful, you will also need a grasp of physical design concepts that, while closely tied to the technical aspects of development, include a dimension with which even expert software developers may have little or no experience.

This is the definitive book for all C++ software professionals involved in large development efforts such as databases, operating systems, compilers, and frameworks. It is the first C++ book that actually demonstrates how to design large systems, and one of the few books on object-oriented design specifically geared to practical aspects of the C++ programming language.

In this book, Lakos explains the process of decomposing large systems into physical (not inheritance) hierarchies of smaller, more manageable components. Such systems with their acyclic physical dependencies are fundamentally easier and more economical to maintain, test, and reuse than tightly interdependent systems. In addition to explaining the motivation for following good physical as well as logical design practices, Lakos provides you with a catalog of specific techniques designed to eliminate cyclic, compile-time, and link-time (physical) dependencies. He then extends these concepts from large to very large systems. The book concludes with a comprehensive top-down approach to the logical design of individual components. Appendices include a valuable design pattern "Protocol Hierarchy" designed to avoid fat interfaces while minimizing physical dependencies; the details of implementing an ANSI C compatible C++ procedural interface; and a complete specification for a suite of UNIX-like tools to extract and analyze physical dependencies. Practical design rules, guidelines, and principles are also collected in an appendix and indexed for quick reference.



0201633620B04062001

Downloads

Source Code

Click below for Source Code related to this title:
source code

Sample Content

Table of Contents



Preface.


0. Introduction.

From C to C++.

Using C++ to Develop Large Projects.

Reuse.

Quality.

Software Development Tools.

Summary.

I. BASICS.

1. Preliminaries.

Multi-File C++ Programs.

typedef Declarations.

Assert Statements.

A Few Matters of Style.

Iterators.

Logical Design Notation.

Inheritance versus Layering.

Minimality.

Summary.

2. Ground Rules.

Overview.

Member Data Access.

The Global Name Space.

Include Guards.

Redundant Include Guards.

Documentation.

Identifier-Naming Conventions.

Summary.

II. PHYSICAL DESIGN CONCEPTS.

3. Components.

Components versus Classes.

Physical Design Rules.

The DependsOn Relation.

Implied Dependency.

Extracting Actual Dependencies.

Friendship.

Summary.

4. Physical Hierarchy.

A Metaphor for Software Testing.

A Complex Subsystem.

The Difficulty in Testing “Good” Interfaces.

Design for Testability.

Testing in Isolation.

Acyclic Physical Dependencies.

Level Numbers.

Hierarchical and Incremental Testing.

Testing a Complex Subsystem.

Testing versus Tested.

Cyclic Physical Dependencies.

Cumulative Component Dependency (CCD).

Physical Design Quality.

Summary.

5. Levelization.

Some Causes of Cyclic Physical Dependencies.

Escalation.

Demotion.

Opaque Pointers.

Dumb Data.

Redundancy.

Callbacks.

Manager Class.

Factoring.

Escalating Encapsulation.

Summary.

6. Insulation.

From Encapsulation to Insulation.

C++ Constructs and Compile-Time Coupling.

Partial Insulation Techniques.

Total Insulation Techniques.

The Procedural Interface.

To Insulate or Not to Insulate.

Summary.

7. Packages.

From Components to Packages.

Registered Package Prefixes.

Package Levelization.

Package Insulation.

Package Groups.

The Release Process.

The main Program.

Start-Up Time.

Summary.

III. LOGICAL DESIGN ISSUES.

8. Architecting a Component.

Abstractions and Components.

Component Interface Design.

Degrees of Encapsulation.

Auxiliary Implementation Classes.

Summary.

9. Designing a Function.

Function Specification.

Fundamental Types Used in the Interface.

Special Case Functions.

Summary.

10. Implementing an Object.

Member Data.

Function Definitions.

Memory Management.

Using C++ Templates in Large Projects.

Summary.

Appendix A. Protocol Hierarchy.
Appendix B. Implementing an ANSI C-Compatible C++ Interface.
Appendix C. A Dependency Extractor/Analyzer Package.
Appendix D. Quick Reference.
Index. 0201633620T04062001

Preface

As a member of the IC Division at Mentor Graphics Corporation, I am fortunate to have worked with many bright, talented software engineers, developing very large systems.

Back in 1985, Mentor Graphics became one of the first companies to attempt a truly large project in C++. Back then no one knew how to do that, and no one could have anticipated the cost overruns, slipped schedules, huge executables, poor performance, and incredibly expensive build times that a naive approach would inevitably produce.

Many valuable lessons were learned along the way - knowledge obtained through bitter experience. There were no books to help guide the design process; object-oriented designs on this scale had never before been attempted.

Ten years later, with a wealth of valuable experience under its belt, Mentor Graphics has produced several large software systems written in C++, and in doing so has paved the way for others to do the same without having to pay such a high price for the privilege.

During my 13 years as a C (turned C++) Computer-Aided Design (CAD) software developer, I have seen over and over again that planning ahead invariably produces a higher-quality, more maintainable product. My emphasis at Mentor Graphics has been on helping to ensure that quality is an integral part of the design process from the very start.

In 1990 I developed the graduate course "Object-Oriented Design and Programming" at Columbia University. As the instructor of this course since 1991, I have had the opportunity to share many of the insights that we at Mentor Graphics gained during our industrial-strength software development efforts. Questions and feedback from literally hundreds of graduate students and professional programmers have helped me to crystallize many important concepts. This book is a direct result of that experience. To my knowledge, this is the first text that identifies development and quality issues that arise only in large C++ projects. I hope that this information will be as useful in your work as it is in mine.

Audience

Large-Scale C++ Software Design was written explicitly for experienced C++ software developers, system architects, and proactive quality-assurance professionals. This book is particularly appropriate for those involved in large development efforts such as databases, operating systems, compilers, and frameworks.

Developing a large-scale software system in C++ requires more than just a sound understanding of the logical design issues covered in most books on C++ programming. Effective design also requires a grasp of physical design concepts that, although closely tied to the technical aspects of development, include a dimension with which even expert professional software developers may have little or no experience.

Yet most of the advice presented in this book also applies to small projects. It is typical for a person to start with a small project and then begin to take on larger and more challenging enterprises. Often the scope of a particular project will expand, and what starts out as a small project becomes a major undertaking. The immediate consequences of disregarding good practice in a large project, however, are far more severe than they are for disregarding good practice in a smaller project.

This book unites high-level design concepts with specific C++ programming details to satisfy two needs:

  1. An object-oriented design book geared specifically to practical aspects of the C++ programming language.
  2. A C++ programming book describing how to use the C++ programming language to develop very large systems.

Make no mistake, this is an advanced text. This is not the book from which to learn C++ syntax for the first time, nor is it likely to expose you to the dark corners of the language. Instead, this book will show you how to use the full power of the C++ language in ways that scale well to very large systems.

In short, if you feel that you know C++ well, but would like to understand more about how to use the language effectively on large projects, this book is for you.

Examples in this Text

Most people learn by example. In general, I have supplied examples that illustrate real-world designs. I have avoided examples that illustrate one point but have blatant errors in other aspects of the design. I have also tried to avoid examples that illustrate a detail of the language but serve no other useful purpose.

Except where otherwise indicated, all examples in this text are intended to represent "good design." Examples presented in earlier chapters are therefore consistent with all practices recommended throughout the book. A disadvantage of this approach is that you may see code that is written differently from the code you are used to seeing, without yet knowing exactly why. I feel that being able to use all of the examples in the book for reference compensates for this drawback.

There are two notable exceptions to this practice: comments and package prefixes. Comments for many of the examples in this text have simply been omitted for lack of space. Where they are presented, they are at best minimal. Unfortunately, this is one place where the reader is asked to "do as I say, not as I do" -- at least in this book. Let the reader be assured that in practice I am scrupulous about commenting all interfaces as I write them (not after).

The second exception is the inconsistent use of package prefixes in the early examples of the book. In a large project environment package prefixes are required, but they are awkward at first and take some getting used to. I have elected to omit the consistent use of registered package prefixes until after they are formally presented in Chapter 7, so as not to detract from the presentation of other important fundamental material.

Many texts note that inline functions are used in examples for textual brevity when illustrating intended functionality. Since much of this book is directly related to organizational issues such as when to inline, my tendency will be to avoid inline functions in examples. If a function is declared inline, there is a justification for it beyond notational convenience.

Developing large systems in C++ is a constant series of engineering trade-offs. There are almost no absolutes. It is tempting to make statements using words such as never and always. Such statements allow for a simplified presentation of the material. For the level of C++ programmers whom I expect will read this book, such sweeping statements would be challenged - and rightly so. To avoid getting side-tracked in such situations, I will state what is (almost) always true, and then provide a footnote or a pointer to the exceptional case.

There are a variety of popular file name extensions used to distinguish C++ header files and C++ implementation files. For example:

 Header File Extensions:          .h  .hxx  .H  .h++  .hh  .hpp
Implementation File Extensions: .c .cxx .C .c++ .cc .cpp

Throughout the examples we consistently use the .h extension to identify C++ header files and the .c extension to identify C++ implementation files. In the text, we will frequently refer to header files as .h files and to implementation files as .c files. Finally, all of the examples in this text have been compiled and are syntactically correct using SUN's version of CFRONT 3.0 running on SUN SPARC stations, as well as on HP700 series machines running their native C++ compiler. Of course, any errors are the sole responsibility of the author.

A Road Map

There is a lot of material to cover in this book. Not all readers will have the same background. I have therefore provided some basic (but essential) material in Chapter 1 to help level the field. Expert C++ programmers may choose to skim this section or simply refer to it if needed. Chapter 2 contains a modest collection of software design rules that I would hope every experienced developer will quickly ratify.

Chapter 0: Introduction. An overview of what lies in wait for the large-scale C++ software developer.

PART I: BASICS

Chapter 1: Preliminaries. A review of basic language information, common design patterns, and style conventions used in this book.

Chapter 2: Ground Rules. Important design practices that should be followed in any C++ project.

The remainder of the text is divided into two main sections. The first, entitled "Physical Design Concepts," presents a sequence of important topics related to the physical structure of large systems. The material in these chapters (3 through 7) focuses on aspects of programming that will be entirely new to many readers, and cuts right to the bone of large program design. This section is presented "bottom up," with each chapter drawing on information developed in previous chapters.

PART II: PHYSICAL DESIGN CONCEPTS

Chapter 3: Components. The fundamental physical building blocks of a system.

Chapter 4: Physical Hierarchy. The importance of creating a hierarchy of components with acyclic physical dependencies for testing, maintainability, and reuse.

Chapter 5: Levelization. Specific techniques for reducing link-time dependencies.

Chapter 6: Insulation. Specific techniques for reducing compile-time dependencies.

Chapter 7: Packages. Extending the above techniques to yet larger systems.

The final section, entitled "Logical Design Issues," addresses the conventional discipline of logical design in conjunction with physical design. These chapters (8 through 10) address the design of a component as a whole, summarize the myriad issues surrounding sensible interface design, and address implementation issues in the context of a large-project environment.

PART III: LOGICAL DESIGN ISSUES

Chapter 8: Architecting a Component. An overview of considerations important to the overall design of components.

Chapter 9: Designing a Function. A detailed survey of the issues involved in creating a component's functional interface.

Chapter 10: Implementing an Object. Several organizational issues specific to the implementation of objects in a large-project environment.

Topics found in the appendixes are referenced throughout the text.

Acknowledgments

This book would not have been possible without the diligence of my many colleagues at Mentor Graphics who have contributed to the company's landmark architectural and development efforts.

First and foremost, I would like to recognize the contributions of my friend, colleague, and former college classmate Franklin Klein, who reviewed virtually every page of the manuscript in its raw form. Franklin provided a sounding board for presenting many concepts that will be new to most software developers. The depth of Franklin's wisdom, intelligence, knowledge, diplomacy, and grasp of the nuances of effective communication is unprecedented in my experience. His detailed comments are responsible for countless revisions in the content, flow, and demeanor of the presentation.

Several dedicated and gifted software professionals reviewed all or most of the material in this book during its formative stages. I consider myself fortunate that they agreed to invest their valuable time reviewing this book. I would like to thank Brad Appleton, Rick Cohen, Mindy Garber, Matt Greenwood, Amy Katriel, Tom O'Rourke, Ann Sera, Charles Thayer, and Chris Van Wyk for the enormous energy they spent helping to make this book as valuable as it could be. In particular, I would like to thank Rick Eesley for many fertile discussions and practical recommendations - especially his plea for a summary at the end of each chapter.

Several expert software developers and quality assurance engineers reviewed individual chapters. I would like to thank Samir Agarwal, Jim Anderson, Dave Arnone, Robert Brazile, Tom Cargill, Joe Cicchiello, Brad Cox, Brian Dalio, Shawn Edwards, Gad Gruenstein, William Hopkins, Curt Horkey, Ajay Kamdar, Reid Madsen, Jason Ng, Pete Papamichael, Mahesh Ragavan, Vojislav Stojkovic, Clovis Tondo, Glenn Wikle, Steve Unger, and John Vlissides for their technical contributions. I would also like to thank Lisa Cavaliere-Kaytes and Tom Matheson of Mentor Graphics for their suggestions regarding some of the figures in this text. In addition I would like to acknowledge the contributions of Eugene Lakos and Laura Mengel.

This book might never have been written were it not for a promotional letter I received at Columbia University offering me a complimentary review copy of Rob Murray's book. Since I teach only during the Spring semester, I returned the enclosed form, but requested that the book be sent to Mentor Graphics instead of Columbia. Soon after that, I received a call from Pradeepa Siva (of Addison-Wesley's Corporate & Professional Publishing Group) determined to get to the bottom of this unusual request. After convincing her of its legitimacy (and some perhaps gratuitous self aggrandizement) she remarked, "I think my boss would like to talk with you." A few days after that, I met with her boss - the publisher. I had always revered the excellence of the Professional Computing Series produced by this group, and it is that reputation that ultimately compelled me to commit to writing this book for that series.

I owe a great deal to the members of the Corporate & Professional Publishing Group at Addison-Wesley. John Wait, its publisher, has patiently provided me with insights into people and communication that I will forever cherish. From relentlessly reading books and reviews, to direct discussions with individual software professionals, to standing in bookstores and discretely observing the buying habits of potential readers, John Wait has his fingers on the pulse of the industry.

The production staff headed by Marty Rabinowitz is dedicated to excellence in all its respects. Despite apprehension expressed to me by authors in academia (associated with other publishers), I was delighted with the tremendous importance placed by Marty on delivering a technically accurate, readily usable, and aesthetically appealing rendering of the author's ideas. I especially want to thank Frances Scanlon for her tireless and seemingly endless efforts in typesetting this entire book.

Brian Kernighan, the technical editor of this series, provided valuable contributions on both style and substance, as well as finding many typographical errors and inconsistencies that no one else caught. The depth and breadth of his knowledge coupled with his concise writing style has in no small way contributed to the success of this series.

Finally, I would like to thank the other authors in this series for documenting fundamental logical concepts and design practices that this book takes for granted.



0201633620P04062001

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020