Your Attention Please!
Total Page:16
File Type:pdf, Size:1020Kb
Your attention please! The following text was published as a book by Prentice Hall in 1994. It has since gone out of print, and the copyright was formally reversed back to the authors Kim Waldén and Jean-Marc Nerson in 2001. We have decided to make the text publicly available with the following provision. You may download and copy the text at will, but as soon as some part is extracted and presented out of context of the complete book, there must always be a clearly visible reference to the book and its authors, and also a pointer to the website www.bon-method.com (since the printed book is no longer available) so that any reader of the partial content can quickly find the original full text. The text of this provision must also be included in any such presentation. Seamless Object-Oriented Software Architecture Analysis and Design of Reliable Systems Kim Waldén Jean-Marc Nerson Printed version September 6, 1994 Contents Series editor’s preface xi Preface xiii Part I Introduction 1 1 Object-oriented software development 3 1.1 Introduction 3 1.2 Seamlessness 7 1.3 Reversibility 7 1.4 Software contracting 9 2 The BON approach 11 2.1 Introduction 11 2.2 What is not in BON 12 2.3 Other methods 15 2.4 The BON position 16 2.5 Characteristics of the notation 17 2.6 Static and dynamic models 24 Part II The model 27 3 The static model—classes and clusters 29 3.1 Introduction 29 3.2 BON modeling charts 30 3.3 System state information 35 3.4 Typed class interfaces 36 3.5 Class header 37 3.6 Indexing clause 37 v vi CONTENTS 3.7 Inheritance clause 39 3.8 Class features 39 3.9 Class invariant 47 3.10 Graphical and textual specification 48 3.11 The BON assertion language 49 3.12 The BON predicate logic 52 3.13 Assertions and partial functions 57 3.14 Scalable system description 59 3.15 Class headers 59 3.16 Clusters 60 4 Static relations 65 4.1 Inheritance relations 65 4.2 Client relations 69 4.3 Class vs. object dependencies 86 4.4 Indirect client dependencies 88 4.5 Semantic links 89 5 The dynamic model 90 5.1 Introduction 90 5.2 Dynamic charts 93 5.3 Dynamic diagrams 99 Part III The method 117 6 Issues of a general method 119 6.1 Introduction 119 6.2 Simulating an ideal process 120 6.3 Enterprise modeling 121 6.4 What is analysis and what is design? 122 6.5 Reuse 125 6.6 User centered design 129 6.7 Roles of analysis objects 135 6.8 Modeling a system interface 136 6.9 System usage 140 6.10 A paradigm shift 142 CONTENTS vii 7 The BON process 143 7.1 The BON deliverables 143 7.2 Characteristics of the process 148 7.3 Task 1: Delineate system borderline 152 7.4 Task 2: List candidate classes 160 7.5 Task 3: Select classes and group into clusters 162 7.6 Task 4: Define classes 166 7.7 Task 5: Sketch system behaviors 168 7.8 Task 6: Define public features 171 7.9 Task 7: Refine system 172 7.10 Task 8: Generalize 174 7.11 Task 9: Complete and review system 175 8 BON standard activities 178 8.1 Finding classes 178 8.2 Classifying 189 8.3 Clustering 194 8.4 Defining class features 198 8.5 Selecting and describing object scenarios 203 8.6 Working out contracting conditions 205 8.7 Assessing reuse 212 8.8 Indexing and documenting 215 8.9 Evolving the system architecture 220 Part IV Case studies 229 9 A conference management system 231 9.1 System borderline 232 9.2 Candidate classes in the problem domain 235 9.3 Class selection and clustering 236 9.4 Class definition 242 9.5 System behavior 252 9.6 Formal class description 260 10 A video recorder 270 10.1 System borderline 270 viii CONTENTS 10.2 Candidate classes 274 10.3 Class selection and clustering 275 10.4 Class definition 279 10.5 System behavior 283 10.6 Formal class description 286 10.7 Final static architecture 288 11 Relational and object-oriented coexistence 289 11.1 From data storage to object persistence 290 11.2 Object models and relational models 293 11.3 A relational database wrapper 295 11.4 Interfacing an existing relational schema 303 11.5 Querying a persistent object model 312 11.6 Persistent object management 315 11.7 Automatic generation of SQL statements 324 11.8 Full static architecture 331 12 Exercises 332 12.1 Clustering a problem domain 332 12.2 Defining class relationships 334 12.3 Assertions and classification 335 12.4 Dynamic behavior 336 12.5 Prescription and description 337 12.6 Traffic-control system 338 12.7 Dice game 339 12.8 Car rental company 340 12.9 Truck freight 341 12.10 Real-time process control 345 Part V Appendices 347 Appendix A BON textual grammar 349 A.1 Introduction 349 A.2 The syntax notation 350 A.3 BON specification 352 A.4 Informal charts 352 CONTENTS ix A.5 Static diagrams 354 A.6 Class interface description 355 A.7 Formal assertions 357 A.8 Dynamic diagrams 358 A.9 Notational tuning 359 A.10 Lexical components 359 Appendix B BON textual examples 364 B.1 BON specification 364 B.2 Informal charts 365 B.3 Static diagrams 367 B.4 Dynamic diagrams 374 Appendix C BON quick reference 381 Appendix D Other approaches 386 Appendix E Glossary of terms 388 References 411 Index 425 x CONTENTS Series editor’s preface A rumor has been spreading for some time among people that follow progress in object-oriented analysis and design: “Wait for BON!” Those not in the know would ask what in the world BON could be. Indeed, the publicity around the Business Object Notation has been modest—an article in the Communications of the ACM, presentations at a workshop or two, public seminars in Europe and North America, tutorials at TOOLS and other conferences—but it was enough to attract the attention of many O-O enthusiasts who were dissatisfied with the limitations of first-generation analysis methods. In the meantime, BON was being taught to many practitioners, applied in numerous industrial projects, and repeatedly polished as a result. As this book finally reaches publication it is certain to cause a major advance in the field of object-oriented methods. Its most remarkable feature is the thoroughness with which it applies object-oriented principles, unencumbered by leftovers from earlier methods. Going O-O all the way is not a matter of dogmatism, but the secret for obtaining the real benefits of the method, following in particular from two principles developed at length in the book: seamless development, the removal of artificial gaps and mismatches between successive software development activities; and reversibility, the recognition that at any step of the development process, including implementation and maintenance, it must be possible to update the results of earlier phases such as analysis and design, and still maintain full consistency between the analysis, design, implementation and maintenance views. By ensuring seamlessness and reversibility it is possible to obtain a continuous software development process, essential to the quality of the resulting products. This book is also one of a select few in the OOAD literature that pays serious attention to the question of software reliability, by using some elements of formal reasoning, in particular assertions, as a way to specify semantic properties of a system at the earliest possible stage. Following the presentation of the model and method in parts I, II, and III, a large section of the book (part IV) is devoted to a set of in-depth case studies and to exercises, drawn for the most part from projects in which the authors acted as xi xii SERIES EDITOR’S PREFACE consultants. This abundant practical material will help readers apply the ideas of BON to their own application areas. From now on, no one will be able to claim knowledge of object-oriented analysis and design who has not read Kim Waldén and Jean-Marc Nerson. Bertrand Meyer Preface In the past few years, object-oriented techniques have finally made the passage from the programming-in-the-small island to the mainland of programming-in- the-large. Accompanying this transition has been a change in the role and perception of software methods: in addition to their well-established use in the earliest stages of a project—requirements analysis and system specification— they are increasingly viewed as providing the intellectual support needed across the entire software construction process, through design and implementation to maintenance and reengineering. The object-oriented approach is best suited to achieve this seamlessness of the software development process, without which it would not be possible to meet the quality and productivity challenges that confront the software industry. This book shows how a consistent set of object-oriented abstractions can be applied throughout the process, based on three major ideas: seamlessness, reversibility, and contracting. Seamlessness, as in the first word of the title, follows from the observation that the similarities between the tasks to be carried out at the various steps of a project far outweigh their inevitable differences, making it possible to obtain a continuous process that facilitates communication between the various actors involved, ensures a direct mapping between a problem and its software solution, and results in a high level of quality for the final product.