Object-Oriented Design Choices
First Edition published 2021
by CRC Press
6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742
and by CRC Press
2 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN
2021 Adair Dingle
CRC Press is an imprint of Taylor & Francis Group, LLC
The right of Adair Dingle to be identified as author of this work has been asserted by her in accordance with sections 77 and 78 of the Copyright, Designs and Patents Act 1988.
Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, access
Trademark notice: Product or corporate names may be trademarks or registered trademarks and are used only for identification and explanation without intent to infringe.
Library of Congress Cataloging-in-Publication Data
Names: Dingle, Adair, author.
Title: Object-oriented design choices / Adair Dingle.
Description: First edition. | Boca Raton : CRC Press, 2021. | Includes bibliographical references and index.
Identifiers: LCCN 2020043691 | ISBN 9780367820183 (paperback) | ISBN 9780367820817 (hardback) | ISBN 9781003013488 (ebook)
Subjects: LCSH: Object-oriented programming (Computer science) | Computer software--Development.
Classification: LCC QA76.64 .D56 2021 | DDC 005.1/17--dc23
LC record available at https://lccn.loc.gov/2020043691
ISBN: 978-0-367-82081-7 (hbk)
ISBN: 978-0-367-82018-3 (pbk)
ISBN: 978-1-003-01348-8 (ebk)
Typeset in Minion
by KnowledgeWorks Global Ltd.
Contents
Table of Contents
Page List
Landmarks
WHY THIS BOOK?
A classic software engineering adage is anyone can build a doghouse. The idea is that doghouses are not usually equipped with indoor plumbing, central heat and ventilation, and are not mortgaged, multistory or subject to building codes, etc. The list goes on. In contrast, a skyscraper must meet building codes, is likely multistory and multi-use, and, traditionally has underground parking, etc. The analogy for software development is that small-scale endeavors may be undertaken with far less overhead, and are subject to far less scrutiny than large-scale or complex systems. Design becomes more important as scale, complexity, and/or performance expectations increase.
Why then read this book? The short answer is to study software design from a structured but hands-on perspective and to understand different designs to manage types, program memory, dynamic behavior, extensibility, etc. Software complexity, refactoring expectations, and the prominence of legacy systems motivate an interest in software design. We evaluate and compare designs in this text using and contrasting C# and C++ implementations.
Software tools, standard libraries, testing methodologies, and modern IDEs have decreased the complexity of producing software. Hardware and environmental dependencies have been abstracted away. Data storage and retrieval have been streamlined. Utilities provide functions for sorting, selection, and comparison. Standard algorithms have been encoded. Yet, one design does not fit all. Many problems may be solved in more than one way. How does one choose the most appropriate design?
This text emphasizes design choices. Many CS texts are learn to books that focus on a specific programming language or tool. When perspective is so limited, high-level concepts are often slighted. Students may gain exposure to an idea via a cookbook implementation and fail to recognize foundational paradigms. Students and/or practitioners can apply principles more readily when design is explicitly defined, illustrated, and evaluated. This book analyzes competing design solutions, contrasting cost, and benefits as well and internal versus external perspectives. Expectations of code reuse trigger consideration of long-term versus short-term use. Design, not just syntax, must be stressed.
WHO SHOULD READ THIS BOOK?
This text originated from material developed and updated for an advanced undergraduate course on software design. Students then are a natural audience. Entry-level or immediate developers, especially those responsible for maintaining or refactoring a legacy system written in an Object-Oriented Programming Language (OOPL), may benefit from this explicit exposition of object-oriented design as well as the evaluation of design variants.
Some software development experience is assumed, as is knowledge of basic data structures. Expertise with any particular language, platform, or IDE is not required. Auxiliary definitions and references are noted in the text. present and analyze substantive design examples. An extensive glossary is included, defining over 150 common terms associated with software design.
WHAT SHOULD READERS EXPECT TO GAIN FROM THIS TEXT?
This book provides a practical summary of object-oriented design (OOD), an emphasis on contractual design, a succinct overview of memory management and data integrity responsibilities, and evaluation of comparative design options, all promoting utility and reuse. Additionally, developers with backgrounds in either C++ or C#/Java, but not necessarily both, may benefit from explanations of language differences.
Sample design quandaries addressed are when to use inheritance (polymorphism) and when not; how to design extensible code; when to externalize dependencies; and how to simulate multiple inheritance. Each chapter ends with one or more problems which illustrate the key concepts just covered. Appendices provide solutions alongside analyses to reinforce a clear understanding of design and implementation.
HOW IS THIS TEXT RELEVANT TO (PROFESSIONAL) SOFTWARE DEVELOPMENT?
In the rush to fill technical positions, acquisition of skills may be prioritized over concepts: learn a new programming language, use a new tool, assess a user interface in order to add functionality to an existing system, etc. A high-level perspective may be lost. Without such a perspective, software development may yield applications that are feature-rich but not easily usable or reusable. To place design into context, we uncover background processes and discuss reuse potential so that a software developer can gauge the impact of design.
WHO MIGHT NOT BENEFIT FROM READING THIS BOOK?
Developers with extensive software design and implementation experience may find this text too elementary, unless more exposure to contractual software design or a transition to OOD is desired. Developers interested in examining real-time systems, event-handling software, or distributed systems should consult a different text.
Next page