Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Tài liệu software engineering pptx
Nội dung xem thử
Mô tả chi tiết
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-inthe-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.
Reversibility means that the seamless procedure must work in both directions:
if one modifies a system that has already reached the implementation phase—a
frequent case in practice—it must be possible to reflect the modification back to
the higher levels of design, specification, and analysis. Without such
reversibility the products of these earlier stages would soon become obsolete,
raising disturbing questions about their very role in the software process. Since
current object-oriented methods are still dominated by hybrid approaches—that
is to say, encumber the application of object-oriented principles with techniques
drawn from non-object-oriented analysis methods and with constructs drawn
from non-object-oriented languages—reversibility has so far been almost absent
from the concerns of the object-oriented literature.
xiii
xiv PREFACE
The contract model was introduced to a wider audience as early as 1988 by
Bertrand Meyer in his magnificent introductory book Object-Oriented Software
Construction (OOSC), which quickly became, and still is, the standard reference
on basic object-oriented concepts. In a sense, the present book is a continuation
of OOSC, carrying some of its software engineering ideas to their logical
conclusion in the area of analysis and design. The result is a method called BON
(Business Object Notation) which contains a set of concepts and corresponding
notations to support object-oriented modeling centered around the three
principles of seamlessness, reversibility, and software contracting.
In the rapidly growing field of object-oriented software development, many
subfields have now accumulated enough experience and techniques to warrant
books of their own. When presenting our ideas, we therefore had to make a
choice: either to cover most of the interesting areas and remain shallow, or to
limit the scope and leave room for more substance. We chose the latter, and
BON concentrates on the basic application-independent ideas of general analysis
and design of software systems.
We have also refrained from including yet another explanation of the basic
object-oriented concepts. There are two main reasons for this. First, the
concepts may be simple enough to define, but understanding their implications in
a deeper sense takes much longer. Therefore, a short overview will not be
enough for those who do not already understand the concepts, while a more
substantial discussion will add significant volume and be utterly boring to
experienced readers. Second, in the general spirit of this book, we believe good
texts should be reused rather than rewritten each time they are needed.
So we will assume that the meaning of classes, instances (objects),
polymorphism, dynamic binding, etc., is already familiar to the reader. If not,
we recommend the OOSC book cited above (a significantly revised second
edition is to appear during 1994). As a small compensation for a basic overview,
we have included a reasonably extensive glossary of terms with brief
explanations of the most important BON concepts and many of the familiar
object-oriented terms. It can be used by the novice as a starting point for further
reading, and by the knowledgeable reader to find out more precisely what flavor
we have chosen for widely used terms whose meaning is not fixed in the objectoriented literature.
BON was initiated in 1989 by Jean-Marc Nerson, then chief developer of the
ISE Eiffel 2.2 environment, who presented early ideas in a tutorial at the second
TOOLS conference held in Paris in 1990. The ideas were picked up at Enea
Data in Sweden by Kim Waldén, then technically responsible for the company’s
Eiffel distribution in Scandinavia, who started to teach courses on BON in
Sweden shortly after. This was the beginning of a collaboration which gradually
led to a joint development of the notation and method. The BON technique was
PREFACE xv
applied in several industrial developments, and Jean-Marc published three
articles in 1991−92. However, we soon realized that more substantial
documentation on the subject would be necessary to make the method available
to a wider audience, and in 1993 we made the bold decision to jointly publish a
book on BON (bold, because the only time available for this work was evenings
and weekends).
As is often the case with visions whose fulfillment requires far more resources
than are available, it is best not to understand the full extent of the work
beforehand—then you can just go ahead and do it anyway, which is what
happened with this book although at the expense of our friends and families.
However, we found that writing about something you believe in wholeheartedly
has the mysterious capacity of extending the number of daily hours well beyond
the standard 24 (in itself a possible subject of another book). If we succeed in
communicating to our readers just a small fraction of the joy involved in writing
this book, the effort will have been worthwhile.
Scope of the book
The book is intended for software professionals as well as for students at the
graduate and undergraduate levels. We believe it can be read by anyone who has
acquired a general understanding of the problems of software engineering, and
who has some inclination for abstract thinking.
The knowledgeable software engineer used to dealing with practical solutions
may discover that it is not all that easy to keep analysis and design models free
from premature implementation decisions. On the other hand, to achieve a deep
understanding of the technology, it is probably even more important for the highlevel analyst to occasionally take an object-oriented design (not necessarily
large) all the way through implementation. Never to do this is somewhat like
trying to become a mountaineer without ever climbing: there is little replacement
for watching polymorphism and dynamic binding in live action.
Book structure
The book consists of an introduction, three main parts, and five appendices. The
main parts treat in order: the concepts and notations of BON; the BON process
for producing analysis and design models; and a practical part with three case
studies and exercises.
The introduction (chapters 1−2) discusses the general principles which have
guided the development of BON and positions the method relative to other
approaches.
The model part (chapters 3−5) explains the static and dynamic models of BON
and the corresponding notation. Untyped modeling charts are used for the very