Bertrand Meyer0136291554, 9780136291558
Table of contents :
INDEX.PDF……Page 0
Preface……Page 3
Simple but powerful……Page 4
Organization of the text……Page 5
A Book-Wide Web……Page 6
The notation……Page 7
The environment……Page 8
Acknowledgments (quasi-absence thereof)……Page 9
Foreword to the second edition……Page 11
About the accompanying CD-ROM……Page 12
On the bibliography, Internet sources and exercise………Page 15
Memory and system requirements……Page 17
Contents……Page 21
Part A: The issues……Page 33
1.1 EXTERNAL AND INTERNAL FACTORS……Page 35
Layers in software development……Page 36
Robustness versus correctness……Page 37
Definition: extendibility……Page 38
Definition: reusability……Page 39
Definition: compatibility……Page 40
Definition: efficiency……Page 41
Definition: ease of use……Page 43
Definition: functionality……Page 44
Osmond’s curves; after [Osmond 1995]……Page 45
About documentation……Page 46
Key concerns……Page 47
Breakdown of maintenance costs. Source: [Lientz 19………Page 49
1.5 BIBLIOGRAPHICAL NOTES……Page 51
How dogmatic do we need to be?……Page 53
Seamlessness……Page 54
Assertions……Page 55
Feature-based computation……Page 56
Static typing……Page 57
Multiple inheritance……Page 58
Constrained genericity……Page 59
Polymorphism……Page 60
Run-time type interrogation……Page 61
Memory management and garbage collection……Page 62
Fast update……Page 63
Documentation……Page 64
Graphics and user interfaces……Page 65
2.6 BIBLIOGRAPHICAL NOTES AND OBJECT RESOURCES……Page 66
Part B: The road to object orientation……Page 69
3 3 Modularity……Page 71
Decomposability……Page 72
A top-down hierarchy……Page 73
Composability……Page 74
Understan- dability……Page 75
Modular continuity……Page 76
Modular protection……Page 77
3.2 FIVE RULES……Page 78
Types of module interconnection structures……Page 79
Communication bandwidth between modules……Page 80
Data sharing……Page 82
A module under Information Hiding……Page 83
Linguistic Modular Units principle……Page 85
Self-Documentation principle……Page 86
Uniform Access……Page 87
Two representation for a bank account……Page 88
Open-Closed principle……Page 89
Old and new clients……Page 90
Adapting a module to new clients……Page 92
Single Choice……Page 93
Single Choice principle……Page 95
3.5 BIBLIOGRAPHICAL NOTES……Page 96
E3.4 Metrics for modularity (term project)……Page 97
E3.6 Configuration management and inheritance……Page 98
4 4 Approaches to reusability……Page 99
Expected benefits……Page 100
Reuse consumers, reuse producers……Page 101
Reuse of designs and specifications……Page 102
Design patterns……Page 103
Reusability through the source code……Page 104
Reuse of abstracted modules……Page 105
4.4 NON-TECHNICAL OBSTACLES……Page 106
The NIH syndrome……Page 107
Software companies and their strategies……Page 108
Accessing components……Page 109
A note about component indexing……Page 110
Formats for reusable component distribution……Page 111
Change and constancy……Page 113
The reuse-redo dilemma……Page 114
4.6 FIVE REQUIREMENTS ON MODULE STRUCTURES……Page 115
Representation Independence……Page 116
Factoring Out Common Behaviors……Page 117
Some possible table implementations……Page 118
Array representation of sequential table with cur………Page 119
Sequential file representation of a sequential tab………Page 120
Routines……Page 121
Packages……Page 122
Packages: an assessment……Page 124
Syntactic overloading……Page 125
Role of overloading……Page 126
Semantic overloading (a preview)……Page 127
Genericity……Page 128
Basic modularity techniques: an assessment……Page 129
4.9 KEY CONCEPTS INTRODUCED IN THIS CHAPTER……Page 130
4.10 BIBLIOGRAPHICAL NOTES……Page 131
The three forces of computation……Page 133
Continuity……Page 135
Top-down development……Page 136
Not just one function……Page 137
Structure of a simple payroll program……Page 138
Finding the top……Page 139
Functions and evolution……Page 140
Interfaces and software design……Page 141
Premature ordering……Page 142
Ordering and O-O development……Page 143
Reusability……Page 144
The context of a module in top-down design……Page 145
5.3 OBJECT-BASED DECOMPOSITION……Page 146
Compatibility……Page 147
OBJECT MOTTO……Page 148
Finding the object types……Page 149
Describing the relations and structuring software……Page 150
5.7 BIBLIOGRAPHICAL NOTES……Page 151
6 6 Abstract data types……Page 153
6.2 IMPLEMENTATION VARIATIONS……Page 154
Three possible representations for a stack……Page 155
Head-to-head representation for two stacks……Page 156
How long is a middle initial?……Page 157
Using the operations……Page 158
Name consistency……Page 159
How not to handle abstractions……Page 160
Genericity……Page 163
6.4 FORMALIZING THE SPECIFICATION……Page 161
Specifying types……Page 162
Listing the functions……Page 164
Applying the put function……Page 165
Function categories……Page 166
The AXIOMS paragraph……Page 167
Applying the put function……Page 168
Two or three things we know about stacks……Page 169
Preconditions……Page 170
ADT specification of stacks……Page 171
Nothing but the truth……Page 172
Stack manipulations……Page 173
Definition: deferred, effective class……Page 174
The role of deferred classes……Page 175
The ADT view of a module under information hiding……Page 176
Introducing a more imperative view……Page 177
Back to square one?……Page 178
6.6 BEYOND SOFTWARE……Page 179
6.7 SUPPLEMENTARY TOPICS……Page 180
More on implicitness……Page 181
Classes versus records……Page 182
Alternatives to partial functions……Page 183
Is my specification complete?……Page 185
Definition: correct ADT expression……Page 186
Definition: ADT consistency……Page 187
Weight Consistency rule……Page 188
STACK AXIOMS……Page 189
Canonical Reduction rule……Page 190
6.8 KEY CONCEPTS INTRODUCED IN THIS CHAPTER……Page 191
6.9 BIBLIOGRAPHICAL NOTES……Page 192
E6.6 Text……Page 193
E6.14 Consistency……Page 194
Part C: Object-oriented techniques……Page 195
Definition: class……Page 197
What would you think of this?……Page 198
The mold and the instance……Page 199
Metaclasses……Page 200
7.3 THE ROLE OF CLASSES……Page 201
The class as module and type……Page 202
Object rule……Page 203
A point and its coordinates……Page 204
Representing a point in polar coordinates……Page 205
Feature classification, by role……Page 206
Feature classification, by implementation……Page 207
The class……Page 208
Recognizing feature kinds……Page 209
The indexing clause……Page 210
Denoting a function’s result……Page 211
Inheriting general-purpose facilities……Page 212
The current instance……Page 213
Definition: client, supplier……Page 214
Feature call……Page 215
Single Target principle……Page 216
The role of Current……Page 217
Qualified and unqualified calls……Page 218
Operator features……Page 219
Restricting client access……Page 223
Style for declaring secret features……Page 224
Exporting to yourself……Page 225
The Big Bang……Page 226
Definition: system execution……Page 227
Definition: system closure……Page 228
Not a main program……Page 229
Assembling a system……Page 230
A directory structure……Page 231
Printing your name……Page 232
Structure and order: the software developer as ars………Page 233
Form of declarations……Page 235
Attributes vs. functions……Page 236
Exporting attributes……Page 237
The client’s privileges on an attribute……Page 238
Possible client privileges on an attribute……Page 239
Optimizing calls……Page 240
The architectural role of selective exports……Page 241
Denoting the result of a function……Page 242
7.11 KEY CONCEPTS INTRODUCED IN THIS CHAPTER……Page 245
7.12 BIBLIOGRAPHICAL NOTES……Page 247
E7.4 Polar coordinates……Page 248
8 8 The run-time structure: objects……Page 249
Definition: object……Page 250
Basic form……Page 251
Simple fields……Page 252
An object representing a book……Page 253
References……Page 254
Two “book” objects with “writer” subobjects……Page 255
An object with a void reference field……Page 256
Object identity……Page 257
Direct and indirect self- reference……Page 258
A possible run- time object structure……Page 259
8.2 OBJECTS AS A MODELING TOOL……Page 260
Molds and their instances……Page 261
Reality: a cousin twice removed……Page 262
Dynamic creation and reattachment……Page 263
The creation instruction……Page 264
Default initialization values……Page 265
The global picture……Page 266
Why explicit creation?……Page 267
Overriding the default initializations……Page 268
Effect of a creation call……Page 269
Rules on creation procedures……Page 270
Multiple creation and overloading……Page 271
Void references and calls……Page 272
Attaching a reference to an object……Page 274
After reference assignment……Page 275
The void value……Page 276
De-attaching a reference from an object……Page 277
Cloning an object……Page 278
Deep clone and comparison……Page 279
Definition: direct dependents, dependents……Page 282
“Book” and “Writer” objects……Page 283
Persistence Closure principle……Page 284
Expanded types……Page 286
Definition: expanded type……Page 287
The role of expanded types……Page 288
“Knows about” and “contains” relations between obj………Page 289
Properties of expanded types……Page 290
Expanded Client rule……Page 291
A subobject with a reference to another object……Page 292
Attachment……Page 293
Reference and copy attachment……Page 294
Hybrid attachments……Page 295
Equality comparison……Page 296
Dynamic aliasing……Page 297
The semantics of aliasing……Page 298
Coming to terms with dynamic aliasing……Page 299
A linked circular list……Page 300
Encapsulating reference manipulations……Page 301
8.10 DISCUSSION……Page 302
Graphical conventions……Page 303
Simula-style notations for operations on reference………Page 304
The form of clone and equality operations……Page 306
8.11 KEY CONCEPTS INTRODUCED IN THIS CHAPTER……Page 308
E8.2 Persons……Page 309
E8.3 Notation design……Page 310
Object creation……Page 311
The static mode……Page 312
The free (heap- based) mode……Page 313
Space reclamation in the three modes……Page 314
Detachment……Page 315
Detachment is not always death……Page 316
Reachable objects in classical approaches……Page 317
Live objects (in color) and dead objects (in black………Page 318
Entity allocation for a procedure……Page 319
Reachability in the object- oriented model……Page 320
Objects attached to local entities……Page 321
The three answers……Page 322
Do we care about memory any more?……Page 323
A byte here, a byte there, and soon we will be tal………Page 324
9.3 RECLAIMING MEMORY: THE ISSUES……Page 325
The reliability issue……Page 326
The ease of development issue……Page 327
Direct and indirect self- reference……Page 328
Managing space for a linked list……Page 329
Dealing with recycled objects……Page 331
Discussion……Page 332
The need for automatic techniques……Page 333
9.7 REFERENCE COUNTING……Page 334
Uncollectible cyclic structure……Page 335
The garbage collection mechanism……Page 336
Garbage collector properties……Page 337
All-or-nothing collection……Page 338
Parallel garbage collection algorithms……Page 340
Class MEMORY……Page 341
A disposal mechanism……Page 342
Garbage collection and external calls……Page 343
Challenges……Page 344
Garbage collection mechanism……Page 345
Garbage collector operation……Page 346
9.12 BIBLIOGRAPHICAL NOTES……Page 347
E9.4 Sharing more……Page 348
10.1 HORIZONTAL AND VERTICAL TYPE GENERALIZATION……Page 349
Generic abstract data types……Page 350
The role of typing……Page 351
10.3 GENERIC CLASSES……Page 352
Declaring a generic class……Page 353
Terminology……Page 354
The type rule……Page 355
Uses of entities of a formal generic type……Page 356
Arrays as objects……Page 357
Array properties……Page 358
Efficiency considerations……Page 359
10.5 THE COST OF GENERICITY……Page 360
10.6 DISCUSSION: NOT DONE YET……Page 361
E10.1 Constrained genericity……Page 362
E10.3 Using your own formal generic parameter as s………Page 363
11 11 Design by Contract: building reliable softwa………Page 365
11.1 BASIC RELIABILITY MECHANISMS……Page 366
Software Correctness property……Page 367
Correctness formulae……Page 368
Weak and strong conditions……Page 369
Sinecure 2……Page 370
11.4 INTRODUCING ASSERTIONS INTO SOFTWARE TEXTS……Page 371
A stack class……Page 372
A pedagogical note……Page 374
Rights and obligations……Page 375
Zen and the art of software reliability: guarantee………Page 376
Non-Redundancy principle……Page 377
Assertions are not an input checking mechanism……Page 379
Assertion Violation rule (1)……Page 380
Terms to denote software woes……Page 381
Stack implemented with an array (see page 123 for ………Page 382
The imperative and the applicative……Page 385
A note on empty structures……Page 387
Precondition design: tolerant or demanding?……Page 388
Reasonable Precondition principle……Page 390
Preconditions and export status……Page 391
Precondition Availability rule……Page 392
A tolerant module……Page 393
Definition and example……Page 397
Form and properties of class invariants……Page 398
The life of an object……Page 399
Invariant rule……Page 400
The role of class invariants in software engineeri………Page 401
Invariants and contracting……Page 402
The correctness of a class……Page 403
(This figure first appeared on page 366.)……Page 404
The role of creation procedures……Page 405
Arrays revisited……Page 406
Not just a collection of functions……Page 407
Expressing the axioms……Page 408
Class-ADT Consistency property……Page 409
Implementation invariants……Page 410
Same abstract object, two representations……Page 411
11.11 AN ASSERTION INSTRUCTION……Page 412
Loop trouble……Page 414
From [M 1990]……Page 415
Getting loops right……Page 416
Ingredients for a provably correct loop……Page 417
A loop computation (from [M 1990])……Page 418
Loop syntax……Page 420
Using assertions for documentation: the short form………Page 423
Monitoring assertions at run time……Page 426
How much assertion monitoring?……Page 428
Why run-time monitoring?……Page 432
The expressive power of assertions……Page 433
Including functions in assertions……Page 434
Class invariants and reference semantics……Page 437
Consistency of forward and backward references……Page 438
Violating the invariant……Page 439
11.15 KEY CONCEPTS INTRODUCED IN THIS CHAPTER……Page 440
11.16 BIBLIOGRAPHICAL NOTES……Page 441
E11.2 A class and its ADT……Page 442
E11.9 Random number generators……Page 443
POSTSCRIPT: THE ARIANE 5 CRASH……Page 444
Failures……Page 445
Sources of exceptions……Page 446
Causes of failure……Page 447
How not to do it — a C-Unix example……Page 448
How not to do it — an Ada example……Page 449
Ada Exception rule……Page 450
Disciplined Exception Handling principle……Page 451
The call chain……Page 452
Rescue and Retry……Page 453
An exception history table……Page 454
An exception history table……Page 455
Fragile input……Page 456
Recovering from hardware or operating system excep………Page 457
Retrying for software fault tolerance……Page 458
N-version programming……Page 460
The correctness of a rescue clause……Page 461
The life of an object……Page 462
A clear separation of roles……Page 463
When there is no rescue clause……Page 464
Exception queries……Page 465
Developer exceptions……Page 468
12.7 DISCUSSION……Page 469
Should exceptions be objects?……Page 470
12.8 KEY CONCEPTS INTRODUCED IN THIS CHAPTER……Page 471
E12.2 Exception objects……Page 472
External routines……Page 473
Advanced variants……Page 474
Object-oriented re-architecturing……Page 475
The compatibility issue: hybrid software or hybrid………Page 477
13.2 ARGUMENT PASSING……Page 478
Permissible operations on a reference argument……Page 479
Qualified Call rule……Page 481
Conditional……Page 482
Multi-branch……Page 483
Loop……Page 485
Manifest constants……Page 486
Expressions with operators……Page 487
Non-strict boolean operators……Page 488
13.5 STRINGS……Page 490
13.7 LEXICAL CONVENTIONS……Page 491
E13.2 Avoiding non-strict operators……Page 492
14 14 Introduction to inheritance……Page 495
Polygons……Page 496
Rectangles……Page 498
An inheritance link……Page 500
Inheritance and creation……Page 501
Creation Inheritance rule……Page 502
Polymorphic attachment……Page 503
Figure type hierarchy……Page 504
Polymorphic reference reattachment……Page 505
Polymorphic data structures……Page 506
Dimensions of generalization……Page 507
Type consistency……Page 508
Feature Call rule……Page 509
Type Conformance rule……Page 510
Static type, dynamic type……Page 511
Are the restrictions justified?……Page 512
attachment……Page 513
When you want to force a type……Page 514
Polymorphic creation……Page 515
Using the right variant……Page 516
Redefinition and assertions……Page 517
Moving arbitrary figures……Page 518
The FIGURE hierarchy again……Page 519
Effecting a feature……Page 520
Definition: redeclaration……Page 521
Deferred class declaration rule……Page 522
Deferred Class No-Instantiation rule……Page 523
List with cursor……Page 524
Cursor positions……Page 526
Redeclaring a function into an attribute……Page 527
Not the other way around……Page 528
Using the original version in a redefinition……Page 529
The dual perspective……Page 530
The module view……Page 531
The type view……Page 533
Inheritance and decentralization……Page 534
The extension-specialization paradox……Page 536
Back to abstract data types……Page 537
Variants of the notion of table……Page 540
Don’t call us, we’ll call you……Page 541
Programs with holes……Page 542
Deferred classes for analysis and global design……Page 543
Dynamic binding and efficiency……Page 544
Estimating the overhead……Page 546
Static binding as an optimization……Page 547
Dynamic Binding principle……Page 548
The C++ approach to binding……Page 550
14.10 KEY CONCEPTS INTRODUCED IN THIS CHAPTER……Page 553
E14.2 How few vertices for a polygon?……Page 554
E14.8 Kinds of deferred feature……Page 555
E14.9 Complex numbers……Page 556
15.1 EXAMPLES OF MULTIPLE INHERITANCE……Page 557
º that is a case of repeated inheritance……Page 558
Company planes……Page 559
Numeric and comparable values……Page 560
Windows and subwindows……Page 562
Trees are lists and list elements……Page 563
Definition: tree……Page 564
A composite figure……Page 565
A composite figure is a figure and a list of figur………Page 566
A marriage of convenience……Page 568
Facility inheritance……Page 570
Buttonholes……Page 571
An assessment……Page 572
Name clashes……Page 573
A name clash, removed……Page 575
Local name adaptation……Page 576
Using a parent’s creation procedure……Page 577
The flat form……Page 579
Uses of the flat form……Page 580
Repeated inheritance……Page 581
Sharing and replication……Page 582
Kinds of driver……Page 583
Repeated Inheritance rule……Page 584
Attribute replication……Page 585
Redundant inheritance……Page 586
Single Name rule……Page 587
Conflicts under sharing: undefinition and join……Page 589
Two parents with features to be merged……Page 590
The need for selection……Page 591
Keeping the original version of a redefined featur………Page 593
An advanced example……Page 595
Window variants……Page 596
Repeated inheritance and genericity……Page 599
Name clashes: definition and rule……Page 600
Renaming……Page 601
O-O development and overloading……Page 602
15.6 KEY CONCEPTS INTRODUCED IN THIS CHAPTER……Page 604
E15.6 Circular lists and chains……Page 605
E15.10 Repeated inheritance for replication……Page 606
16.1 INHERITANCE AND ASSERTIONS……Page 607
The routine, the client and the contract……Page 608
The routine, the client, the contract and the desc………Page 609
How to cheat clients……Page 610
An example……Page 611
The routine, the client and the sub- contractor……Page 613
Abstract preconditions……Page 614
Assertion Redeclaration rule (2)……Page 616
Redeclaring into attributes……Page 617
Universal Class rule……Page 618
The global inheritance structure……Page 619
Universal features……Page 620
Fixed semantics for copy, clone and equality featu………Page 621
Addable vectors……Page 623
Adding two vectors, item by item……Page 625
Constraining the generic parameter……Page 626
Unconstrained genericity revisited……Page 628
When type rules become obnoxious……Page 629
The challenge……Page 630
The mechanism……Page 631
Using assignment attempt properly……Page 633
Devices and printers……Page 634
A linkable cell……Page 635
Parallel hierarchies……Page 636
Type inconsistencies……Page 637
Application-oriented examples……Page 638
A serious problem……Page 639
The notion of anchor……Page 640
Base classes revisited……Page 641
When not to use anchored declaration……Page 642
A static mechanism……Page 643
Applications……Page 644
Why the flexibility?……Page 645
Interface and implementation reuse……Page 646
The two styles……Page 647
16.9 KEY CONCEPTS INTRODUCED IN THIS CHAPTER……Page 648
E16.3 Extract?……Page 649
The Basic Construct……Page 651
Definition: statically typed language……Page 652
Realism……Page 653
Pessimism……Page 654
After [Boehm 1981]. Reproduced with permission…….Page 655
The ingredients of successful typing……Page 656
Multiple inheritance……Page 657
“A little bit typed”?……Page 658
Typing and binding……Page 659
Kinds of flying object……Page 660
Covariance……Page 661
Kinds of skier……Page 662
Skier hierarchy and redefinitions……Page 664
Parallel hierarchies……Page 665
Polymorphic perversity……Page 666
Descendant hiding……Page 667
Practical scope……Page 668
Using generic parameters……Page 669
17.5 RELYING ON ANCHORED TYPES……Page 670
17.6 GLOBAL ANALYSIS……Page 674
System Validity rule……Page 675
Catcall type rule……Page 677
Definition: Polymorphic entity……Page 678
17.8 AN ASSESSMENT……Page 679
17.9 THE PERFECT FIT……Page 680
17.11 BIBLIOGRAPHICAL NOTES……Page 682
18.1 CONSTANTS OF BASIC TYPES……Page 685
Constant attributes……Page 686
18.2 USE OF CONSTANTS……Page 687
Manifest constants are inappropriate for class typ………Page 688
Once functions……Page 689
Shared objects……Page 690
Once functions returning results of basic types……Page 692
Arguments……Page 693
Once functions, anchoring and genericity……Page 694
18.5 CONSTANTS OF STRING TYPE……Page 695
18.6 UNIQUE VALUES……Page 696
Discrimination principle……Page 697
Initializing globals and shared objects: language ………Page 698
Unique values and enumerated types……Page 699
18.8 KEY CONCEPTS INTRODUCED IN THIS CHAPTER……Page 701
E18.4 Once attributes?……Page 702
Part D: Object-oriented methodology: applying the ………Page 703
19.1 SOFTWARE METHODOLOGY: WHY AND WHAT……Page 705
The need for methodology guidelines……Page 706
Practical Basis methodology principle……Page 707
Absolute positives……Page 708
Advisories……Page 709
Exceptions……Page 710
Abstraction and precision……Page 711
If it is baroque, fix it……Page 712
19.3 ON USING METAPHORS……Page 713
19.4 THE IMPORTANCE OF BEING HUMBLE……Page 715
E19.4 Metaphors on the Net……Page 716
20.1 MULTI-PANEL SYSTEMS……Page 719
A panel……Page 720
A transition diagram……Page 721
The transition function……Page 722
The routine architecture……Page 723
Top-down functional decomposition……Page 724
Statism……Page 726
The flow of data……Page 727
State as a class……Page 728
features……Page 729
Inheritance and deferred classes……Page 730
State class hierarchy……Page 731
Describing a complete system……Page 732
STATE and APPLICATION features……Page 733
The application class……Page 734
A polymorphic array of states……Page 736
20.6 DISCUSSION……Page 737
20.7 BIBLIOGRAPHICAL NOTE……Page 738
Undoing for fun and profit……Page 739
Practical issues……Page 740
Requirements on the solution……Page 741
Command as a class……Page 743
Command class hierarchy……Page 744
The basic interactive step……Page 745
Remembering the last command……Page 746
How to create a command object……Page 747
The history list……Page 748
Implementing Undo……Page 749
Implementing Redo……Page 750
Command arguments……Page 751
Precomputing command objects……Page 752
The array of command templates……Page 753
Bounded circular list implemented by an array……Page 754
A history window, before any undoing……Page 755
21.6 DISCUSSION……Page 756
The role of implementation……Page 757
Small classes……Page 758
E21.1 Putting together a small interactive system ………Page 759
E21.6 Composite commands……Page 760
E21.9 A history mechanism……Page 761
E21.11 Integrable functions……Page 762
22 22 How to find the classes……Page 763
Avoiding useless classes……Page 764
Is a new class necessary?……Page 765
Missing important classes……Page 767
Class Elicitation principle……Page 769
My class performsº……Page 770
Class Name rule……Page 771
Premature classification……Page 772
No-command classes……Page 773
The ideal class……Page 774
Class categories……Page 775
External objects: finding the analysis classes……Page 776
Finding the implementation classes……Page 777
Finding the design classes……Page 778
Adaptation through inheritance……Page 779
Hints from other approaches……Page 780
Files……Page 781
Use cases……Page 782
Use Case principle……Page 783
The bottom-up component……Page 784
22.6 THE METHOD FOR OBTAINING CLASSES……Page 785
Sources of possible classes……Page 786
22.7 KEY CONCEPTS INTRODUCED IN THIS CHAPTER……Page 787
22.8 BIBLIOGRAPHICAL NOTES……Page 788
E22.1 Floors as integers……Page 789
E22.2 Inspecting objects……Page 790
23 23 Principles of class design……Page 791
Forms of side effect……Page 792
Referential transparency……Page 793
Definition: referential transparency……Page 794
A list object as list machine……Page 795
A clean style for class interfaces……Page 796
Pseudo-random number generators: a design exercise………Page 798
An infinite list as a machine……Page 799
Abstract state, concrete state……Page 800
Definition: abstract side effect……Page 801
Objections……Page 802
Legitimate side effects: an example……Page 803
The importance of argument counts……Page 808
Definition: operand and option arguments……Page 810
Operand principle……Page 811
Exceptions to the Operand principle?……Page 813
23.3 CLASS SIZE: THE SHOPPING LIST APPROACH……Page 814
Maintaining consistency……Page 815
Shopping List advice……Page 816
Laxity and restrictiveness……Page 817
Linked list representation……Page 818
Deletion in a linked list……Page 819
Passive classes……Page 820
Encapsulation and assertions……Page 824
Simple-minded solutions……Page 825
Evolution of a library class……Page 826
List with cursor……Page 827
Maintaining consistency: the implementation invari………Page 828
List with sentinels……Page 829
The client’s view……Page 830
Cursor list representation (first variant)……Page 831
Cursor list representation (revised variant)……Page 833
Merging the list and the sentinels……Page 837
Header as sentinel (empty list)……Page 839
23.5 SELECTIVE EXPORTS……Page 841
23.6 DEALING WITH ABNORMAL CASES……Page 842
The a priori scheme……Page 843
Obstacles to the a priori scheme……Page 844
The a posteriori scheme……Page 845
The role of an exception mechanism……Page 846
23.7 CLASS EVOLUTION: THE OBSOLETE CLAUSE……Page 847
23.8 DOCUMENTING A CLASS AND A SYSTEM……Page 848
Documentation principle……Page 849
A system architecture diagram……Page 850
23.10 BIBLIOGRAPHICAL NOTES……Page 851
E23.7 Two-way lists……Page 852
E23.13 Self-documenting software……Page 853
24.1 HOW NOT TO USE INHERITANCE……Page 855
A proper model……Page 856
“Is-a” rule of inheritance……Page 857
To have and to be……Page 858
Another possible view……Page 859
Object and subobject……Page 860
The polymorphism rule……Page 862
24.3 AN APPLICATION: THE HANDLE TECHNIQUE……Page 863
Platform adaptation through inheritance……Page 864
Platform adaptation through a handle……Page 865
Taxomania rule……Page 866
Inheritance rule……Page 868
Wrong uses……Page 869
Classification of the valid categories of inherita………Page 870
Definition: subtype inheritance……Page 871
Definition: extension inheritance……Page 872
Variation inheritance……Page 874
Definition: functional and type variation inherita………Page 875
Definition: uneffecting inheritance……Page 876
Definition: structure inheritance……Page 877
Definition: facility inheritance……Page 878
24.6 ONE MECHANISM, OR MORE?……Page 879
Defining a subtype……Page 881
Enforcing the subtype view……Page 882
The need for descendant hiding……Page 883
A circle and its center……Page 884
Applications of descendant hiding……Page 885
Taxonomies and their limitations……Page 887
Reproduced with the author’s permission. Associate………Page 888
Using descendant hiding……Page 889
It feels so good, but is it wrong?……Page 890
Doing without inheritance……Page 891
Using character codes……Page 893
Iterators……Page 894
Understanding facility inheritance……Page 896
Classifying through multiple criteria……Page 897
A messy classification……Page 898
Classification through views……Page 899
Is view inheritance appropriate?……Page 900
Multi-criteria classification through separate, cl………Page 901
A view-based classification of fundamental computi………Page 902
Building a data structure class by combination of ………Page 903
Specialization and abstraction……Page 904
Induction and deduction……Page 905
Factoring……Page 906
Elevating the level of abstraction……Page 907
24.12 A SUMMARY VIEW: USING INHERITANCE WELL……Page 908
24.14 BIBLIOGRAPHICAL NOTES……Page 909
From Aristotle to Darwin……Page 910
The modern scene……Page 912
After Mayr, 1961…….Page 913
Bibliography on taxonomy……Page 914
E24.6 Classification examples……Page 915
E24.9 Inheritance and polymorphism……Page 916
The structure of systems……Page 917
Designing feature interfaces……Page 918
Redeclaration……Page 919
Forms of inheritance……Page 920
Applying the rules in practice……Page 921
Terseness and explicitness……Page 922
The role of convention……Page 923
Discipline and creativity……Page 924
Composite Feature Name rule……Page 925
Local entities and routine arguments……Page 926
Grammatical categories……Page 927
Standard names for non- boolean queries……Page 928
The benefits of consistent naming……Page 929
Symbolic Constant principle……Page 930
Routine header comments: an exercise in corporate ………Page 932
Feature clause header comments……Page 935
Indexing clauses……Page 936
26.5 TEXT LAYOUT AND PRESENTATION……Page 937
The comb-like structure of software texts……Page 938
Indenting details……Page 940
Note: this class has no useful semantics!……Page 941
Spaces……Page 942
The War of the Semicolons……Page 943
Semicolon Syntax rule……Page 944
Semicolon Style principle……Page 945
Basic font rules……Page 946
Other font conventions……Page 947
E26.2 Semicolon ambiguity……Page 948
Tasks……Page 949
Requirements……Page 950
The clouds and the precipice……Page 951
Requirements analysis as a negotiation……Page 952
27.4 PROGRAMMING A TV STATION……Page 953
Schedules……Page 954
Segments……Page 955
Programs and commercials……Page 957
Assessment……Page 959
27.5 EXPRESSING THE ANALYSIS: MULTIPLE VIEWS……Page 960
Inheritance link……Page 961
27.6 ANALYSIS METHODS……Page 963
27.7 THE BUSINESS OBJECT NOTATION……Page 965
(After [Waldén 1995], used with permission.)……Page 967
27.8 BIBLIOGRAPHY……Page 968
28.1 CLUSTERS……Page 969
(WARNING: this is not the recommended process mode………Page 970
Individual cluster lifecycle……Page 971
28.4 THE CLUSTER MODEL OF THE SOFTWARE LIFECYCLE……Page 972
The cluster model of the software lifecycle……Page 973
A project’s clusters as a set of abstraction layer………Page 974
The reusability culture……Page 975
28.6 SEAMLESSNESS AND REVERSIBILITY……Page 976
Reversibility: wisdom sometimes blooms late in the………Page 977
Individual cluster lifecycle, reversible……Page 978
28.7 WITH US, EVERYTHING IS THE FACE……Page 979
28.9 BIBLIOGRAPHICAL NOTES……Page 980
Initial training: the “hit them twice” strategy……Page 981
Advanced Curriculum principle……Page 982
Phylogeny and ontogeny……Page 983
Language choice……Page 984
29.3 OTHER COURSES……Page 986
Secondary and undergraduate studies……Page 987
The consumer-to-producer strategy……Page 988
Consumer-to-producer strategy……Page 989
Apprenticeship……Page 990
A long-term policy……Page 991
29.5 AN OBJECT-ORIENTED PLAN……Page 992
29.6 KEY CONCEPTS STUDIED IN THIS CHAPTER……Page 993
29.7 BIBLIOGRAPHICAL NOTES……Page 994
30.1 A SNEAK PREVIEW……Page 995
Multiprocessing……Page 997
Multiprogramming……Page 998
Remote execution……Page 999
30.3 FROM PROCESSES TO OBJECTS……Page 1000
Active objects……Page 1001
A simple producer- consumer scheme……Page 1002
Active objects clash with inheritance……Page 1003
Processes programmed……Page 1004
Definition: processor……Page 1008
Handling an object……Page 1009
The dual semantics of calls……Page 1010
Separate entities……Page 1011
Obtaining separate objects……Page 1012
Objects here, and objects there……Page 1013
Two-level architecture for concurrency mechanism……Page 1014
Mapping the processors: the Concurrency Control Fi………Page 1015
Library mechanisms……Page 1016
Separateness consistency rule (1)……Page 1017
Separateness consistency rule (2)……Page 1018
Passing to a separate call an object with referenc………Page 1019
Importing object structures……Page 1020
Synchronization vs. communication……Page 1021
Semaphore operations……Page 1022
Communication-based mechanisms……Page 1023
Synchronization for concurrent O-O computation……Page 1024
(This figure first appeared on page 366.)……Page 1026
Reserving an object……Page 1027
Separate Call rule……Page 1029
Wait by necessity……Page 1031
A multi-launcher……Page 1032
Avoiding deadlock……Page 1033
A buffer is a separate queue……Page 1034
Bounded buffer implemented by an array……Page 1035
Preconditions under concurrent execution……Page 1037
(From the example for stacks on page 343.)……Page 1038
The concurrent semantics of preconditions……Page 1039
Separate call semantics……Page 1040
Assertion Argument rule……Page 1041
Object and processor states and transitions……Page 1042
Duels and their semantics……Page 1043
Interrupt handling: the Secretary-Receptionist Alg………Page 1044
About the rest of this chapter……Page 1046
The philosophers’ spaghetti plate……Page 1047
Making full use of hardware parallelism……Page 1051
Locks……Page 1053
Coroutine sequencing……Page 1056
An elevator control system……Page 1058
A watchdog mechanism……Page 1063
Accessing buffers……Page 1065
30.10 TOWARDS A PROOF RULE……Page 1066
The basic sequential proof technique……Page 1067
Constraints……Page 1069
Definition: satisfiable call……Page 1070
Library mechanisms……Page 1071
Full use of inheritance and other object-oriented ………Page 1072
Support for command-query separation……Page 1073
Support for coroutine programming……Page 1074
Permitting concurrent access?……Page 1075
30.13 KEY CONCEPTS INTRODUCED IN THIS CHAPTER……Page 1076
30.14 BIBLIOGRAPHICAL NOTES……Page 1077
E30.5 Priorities……Page 1079
E30.14 Once routines and concurrency……Page 1080
Storing and retrieving object structures……Page 1081
Storable format variants……Page 1082
Small structure with reference to big shared struc………Page 1083
Naïve approaches……Page 1085
Detection……Page 1086
Notification……Page 1088
Object mismatch……Page 1089
(What is wrong with this picture?)……Page 1090
31.4 FROM PERSISTENCE TO DATABASES……Page 1091
Operations……Page 1092
Queries……Page 1093
31.6 OBJECT-ORIENTED DATABASE FUNDAMENTALS……Page 1094
An object with a reference to another object……Page 1095
(Both bottom references are attached to the same o………Page 1096
The threshold model……Page 1097
Long transactions……Page 1098
31.7 O-O DATABASE SYSTEMS: EXAMPLES……Page 1099
Matisse……Page 1100
Versant……Page 1101
The O-O view……Page 1102
Separating persistence from sharing……Page 1103
31.9 KEY CONCEPTS STUDIED IN THIS CHAPTER……Page 1104
31.10 BIBLIOGRAPHICAL NOTES……Page 1105
E31.2 Object-oriented queries……Page 1106
32 32 Some O-O techniques for graphical interactiv………Page 1107
Graphical systems, window systems, toolkits……Page 1108
The library and the application builder……Page 1109
32.2 PORTABILITY AND PLATFORM ADAPTATION……Page 1110
Graphical libraries architecture……Page 1111
Figures……Page 1112
The graphical abstractions……Page 1113
Operations on windows……Page 1114
Events……Page 1115
32.5 HANDLING THE EVENTS……Page 1116
An exit command……Page 1117
Confirming a command……Page 1118
Partial state diagram for Vi……Page 1119
32.7 BIBLIOGRAPHICAL NOTES……Page 1120
MATHEMATICAL BACKGROUND……Page 1121
32A.2 FINITE SETS, CARTESIAN PRODUCT……Page 1124
32A.3 RELATIONS……Page 1125
32A.4 FUNCTIONS……Page 1126
32A.6 VISUALIZING A FINITE FUNCTION……Page 1127
32A.7 DEALING WITH MULTI-ARGUMENT FUNCTIONS……Page 1128
32A.8 CURRYING……Page 1129
32A.9 A DIGRESSION: CORRECTNESS OF COMPILERS AND I………Page 1131
32A.10 CURRYING FOR VISUAL DISPLAY……Page 1132
32A.11 FUNCTIONS AND CURRYING FOR EIFFELBUILD……Page 1134
Part E: Advanced topics……Page 1136
33.1 A BIT OF CONTEXT……Page 1138
33.3 A STACK IMPLEMENTATION……Page 1140
A simple interface……Page 1141
Using a package……Page 1142
Genericity……Page 1143
33.4 HIDING THE REPRESENTATION: THE PRIVATE STORY……Page 1144
Raising and handling an exception……Page 1147
Discussion……Page 1148
33.6 TASKS……Page 1150
O-O mechanisms of Ada 95: an example……Page 1151
An Ada 95 package……Page 1152
Ada 95 and object technology: an assessment……Page 1153
Discussion: module and type inheritance……Page 1154
Towards an O-O Ada……Page 1155
33.9 BIBLIOGRAPHICAL NOTES……Page 1156
E33.5 Package-classes……Page 1157
Part F: Applying the method in various languages a………Page 1158
34.1 LEVELS OF LANGUAGE SUPPORT……Page 1160
34.2 OBJECT-ORIENTED PROGRAMMING IN PASCAL?……Page 1161
Object-oriented extensions of Pascal……Page 1162
The COMMON technique……Page 1163
The multiple-entry subroutine technique……Page 1165
A stack module emulation in Fortran……Page 1167
Some context……Page 1168
Emulating objects……Page 1170
A C object with function references……Page 1171
Emulating classes……Page 1172
O-O C: an assessment……Page 1173
E34.3 Object-oriented programming in C (term proje………Page 1174
35.1 SIMULA……Page 1176
Major language traits……Page 1177
An example……Page 1180
(This figure appeared originally on page 1012.)……Page 1181
A coroutine example……Page 1182
Sequencing and inheritance……Page 1184
Simulation……Page 1185
An event list……Page 1187
A simulation example……Page 1188
Language style……Page 1189
Messages……Page 1190
Smalltalk: an assessment……Page 1192
35.3 LISP EXTENSIONS……Page 1193
Objective-C……Page 1194
C++……Page 1195
Complexity……Page 1197
C++: an assessment……Page 1198
35.5 JAVA……Page 1199
35.6 OTHER O-O LANGUAGES……Page 1200
C extensions: Objective-C, C++……Page 1201
E35.2 Implicit resume……Page 1202
E35.5 Referring to a parent’s version……Page 1203
Part G: Doing it right……Page 1204
36.1 COMPONENTS……Page 1206
Compilation challenges……Page 1207
The Frozen and the Melted……Page 1208
Precompilation……Page 1209
Optimization……Page 1210
Bench and the development process……Page 1211
36.5 LIBRARIES……Page 1213
(Here on a Sparcstation with Motif, but versions ………Page 1214
Platforms……Page 1215
Tools……Page 1216
A Class Tool in default format……Page 1217
An object and its fields captured during execution………Page 1218
Typed pick- and-throw……Page 1219
The ancestry of a class……Page 1221
36.7 BIBLIOGRAPHICAL NOTES……Page 1223
Part H: Appendices……Page 1224
A.1 ARRAYS……Page 1227
A.2 LINKABLE AND BI-LINKABLE ELEMENTS……Page 1243
A.3 LISTS……Page 1249
A.4 ARRAYED LISTS……Page 1252
A.5 LINKED LISTS……Page 1271
A.6 TWO-WAY LISTS……Page 1291
A.7 TWO-WAY TREES……Page 1305
A A Extracts from the Base libraries……Page 1226
B B Genericity versus inheritance……Page 1315
Unconstrained genericity……Page 1316
Constrained genericity……Page 1318
B.2 INHERITANCE……Page 1321
A simple inheritance hierarchy, with deferred and ………Page 1322
Emulating inheritance……Page 1323
Emulating constrained genericity: overview……Page 1324
Constrained genericity: routines……Page 1325
Emulating constrained genericity (1)……Page 1326
Constrained genericity: packages……Page 1327
Unconstrained genericity……Page 1329
Emulating unconstrained genericity……Page 1331
Unconstrained genericity……Page 1332
Constrained genericity……Page 1333
Emulating constrained genericity (2)……Page 1334
B.6 KEY CONCEPTS INTRODUCED IN THIS APPENDIX……Page 1335
E-B.4 Full queue implementations……Page 1336
C C Principles, rules, precepts and definitions……Page 1337
Behavior class……Page 1341
Current object (or: current instance)……Page 1342
Encapsulation……Page 1343
Generator (of an object)……Page 1344
Message……Page 1345
Organized panic……Page 1346
Program……Page 1347
Runtime (noun, one word)……Page 1348
Static……Page 1349
Variant……Page 1350
E.1 WORKS BY OTHER AUTHORS……Page 1351
E.2 WORKS BY THE AUTHOR OF THE PRESENT BOOK……Page 1369
Epilogue, In Full Frankness Exposing the Language……Page 1375
A……Page 1377
B……Page 1379
C……Page 1380
D……Page 1384
E……Page 1385
F……Page 1387
G……Page 1388
H……Page 1389
I……Page 1390
J……Page 1391
L……Page 1392
M……Page 1393
N……Page 1394
O……Page 1395
P……Page 1397
R……Page 1399
S……Page 1401
T……Page 1403
V……Page 1405
Z……Page 1406
Reviews
There are no reviews yet.