Model-Based Development
Applications
H. S. Lahman
Upper Saddle River, NJ Boston Indianapolis San Francisco
New York Toronto Montreal London Munich Paris Madrid
Capetown Sydney Tokyo Singapore Mexico City
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.
The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact:
U.S. Corporate and Government Sales
(800) 382-3419
For sales outside the United States please contact:
International Sales
Visit us on the Web: informit.com/aw
Library of Congress Cataloging-in-Publication Data
Lahman, H.S.
Model-based development : applications / H.S. Lahman.1st ed.
p. cm.
Includes index.
ISBN 0-321-77407-8 (hardcover : alk. paper)
1. Model-driven software architecture. 2. Application
softwareDevelopment. I. Title.
QA76.76.D47L33 2011
005.1dc23 2011012733
Copyright 2011 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to:
Pearson Education, Inc.
Rights and Contracts Department
501 Boylston Street, Suite 900
Boston, MA 02116
Fax: (617) 671-3447
ISBN-13: 978-0-321-77407-1
ISBN-10: 0-321-77407-8
Text printed in the United States on recycled paper at Courier in Westford, Massachusetts.
First printing, June 2011
Preface
Software development is an enormously complex intellectual activity. It is a relatively young discipline that is still rapidly evolving. It isnt done very well because everyone is still trying to figure out how to do it.
Nonetheless, there has been substantial improvement over the years in the way software is developed. A number of design methodologies have evolved to facilitate various aspects of software design. One was the Structured Design methodology, which provided a very intuitive approach that matched up well with the hardware computational models of Turing and von Neumann.
The Problem
While Structured Design was clearly superior to the ad hoc approaches that preceded it, it had an Achilles heel: the software tended to be difficult to modify when customer requirements changed over time, especially in large applications. At the same time, applications were rapidly growing in size and complexity. In addition, new languages, technologies, operating systems, data storage paradigms, UI paradigms, hardware, and whatnot were arriving on the computing scene with alarming speed. Yet business conditions were driving the need for faster time-to-market and reduced cost of software products.
The Hope
Consequently, a number of new design methodologies appeared that captured hard-won lessons about good and bad practices. They also presented revolutionary views of computing. One of those was the Object-Oriented (OO) paradigm, with the primary goal of ensuring that large applications are maintainable over time as requirements inevitably change during the software products life cycle.
This book is about practicing a particular software design methodology, Model-Based Development (MBD), which is strongly based upon Shlaer-Mellor. Employing the OO paradigm in general and MBD in particular should lead to more robust and maintainable large applications.
This Book
Although the book employs UML as a notation, that is quite peripheral. There are plenty of good books that describe how to express a software design in UML, so UML syntax will not get much mention here. Similarly, this book follows a particular design methodology for MBD, but that is primarily to provide context for the real purpose of this book:
The primary goal of this book is to describe why OO methodologies in general and MBD in particular advocate a particular way of doing things.
There is no single right way to design and develop all software. Too much depends upon the particular development environment, which includes everything from business goals through tools to group culture. In the end, a shop has to decide what set of tools will be most effective in its environment. To do that the decision makers need to understand why the MBD set of methodological tools works in many common situations. More to the point, the practitioners need to understand the fundamentals well enough to adapt them to particular situations.
Practicing OO design requires a unique mindset that is not intuitive in the world of hardware computational models. Rather than focusing on particular notations and methodologies, this book is really about how to think about software design. To that end, this book spends substantial time on the thought processes behind good software designseven to the point of deliberately providing poor preliminary designs to demonstrate that the approach is self-correcting.
To achieve such understanding it is necessary to describe how traditional (pre-OO) approaches to software development failed in some ways and how the OO paradigm addressed those shortcomings. While Structured Development brought substantial order to the chaos of pre-1970 software development, it was not a panacea, and by the 80s it became clear that software still had serious maintainability problems that the OO paradigm addressed.
Similarly, one cannot describe why a methodology works well without discussing at least some of the underlying theory. Nonetheless, this is a book by a software developer for software developers, so a conscious effort has been made to describe theoretical issues in practical terms without mathematical rigor.
rather than a 3GL, but the model will be just as executable as any 3GL program. While the model is implementation independent, it is a complete, precise, and unambiguous specification of the solution for functional requirements.
As a final note, we would point out that the practical development experience of the author is measured in decades rather than years. This is definitely not a theoretical book, despite the emphasis on explaining why things are done. It is based upon what works in the real world.
Road Map
The subject matter of this book is limited to application development at the OOA level. This book is organized into three main sections. describes the dynamic aspects of the solution, particularly the rather militant use of finite state machines to describe behavior.
Intended Audience
A secondary audience is the large number of converts to the OO paradigm from traditional procedural development environments. Many of these developers leapt directly into writing code in an object-oriented programming language (OOPL) since they already had substantial programming experience (i.e., believing that if one has seen one programming language, one has seen them all). Sadly, such converts have written huge volumes of bad OO code because no one told them why Object-Oriented Analysis and Design (OOA/D) is very different from Structured Analysis and Design (SA/D). If you are one of these, you will have to forget everything you ever learned about designing software and start with a clean slate.