Real-Time Design Patterns: Robust Scalable Architecture for Real-Time Systems

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

When creating real-time and embedded (RTE) systems, there is no room for error. The nature of the final product demands that systems be powerful, efficient, and highly reliable. The constraints of processor and memory resources add to this challenge. Sophisticated developers rely on design patterns-proven solutions to recurrent design challenges-for building fail-safe RTE systems.Real-Time Design Patterns is the foremost reference for developers seeking to employ this powerful technique. The text begins with a review of the Unified Modeling Language (UML) notation and semantics then introduces the Rapid Object-Oriented Process for Embedded Systems (ROPES) process and its key technologies. A catalog of design patterns and their applications follows.

Author(s): Bruce Powel Douglass
Publisher: Addison-Wesley Professional
Year: 2002

Language: English
Pages: 342

Real-Time Design Patterns.pdf......Page 0
Table of Content......Page 2
Copyright......Page 5
Foreword......Page 6
Audience......Page 8
More Information......Page 9
Acknowledgments......Page 10
Part I: Design Pattern Basics......Page 11
1.1 Basic Modeling Concepts of the UML......Page 12
1.2 Models......Page 13
Figure 1-1. Basic Class Diagram......Page 14
Code Listing 1: Class Diagram in Java......Page 16
Code Listing 2: Class Diagram in C++......Page 17
Figure 1-2. Association, Aggregation, and Composition......Page 18
1.3.2.3 Composition......Page 20
1.3.2.4 Generalization......Page 21
Code Listing 1-3: MsgQueue::insert() operation......Page 22
Figure 1-4. Generalization......Page 23
1.3.2.5 Dependency......Page 24
Figure 1-5. Dependency......Page 25
1.3.3 Structural Diagrams......Page 26
Figure 1-6. Packages......Page 27
Figure 1-7. Subsystems......Page 29
Figure 1-8. Components......Page 30
1.4.1 Actions and Activities......Page 31
1.4.3 Statecharts......Page 32
Figure 1-10. Simple Statechart......Page 33
Figure 1-11. And-States......Page 34
Figure 1-12. Pseudostates......Page 35
1.4.4 Activity Charts......Page 37
Figure 1-13. Activity Chart......Page 38
Figure 1-14. Collaboration Diagram......Page 39
Figure 1-15. Sequence Diagram......Page 40
Figure 1-16. Sequence Diagram......Page 41
Figure 1-17. Use Cases......Page 42
1.5.1 Capturing Black-Box Behavior Without Revealing Internal Structure......Page 43
1.6 What Is a Design Pattern?......Page 44
References......Page 46
2.1 Architecture......Page 47
Figure 2-2. Logical and Physical Architecture......Page 48
Figure 2-3. Logical Domain Architecture......Page 50
Figure 2-4. Domain Hierarchy......Page 51
Figure 2-5. Relating Logical and Physical Architecture......Page 52
Figure 2-6. Levels of Abstraction in Architecture......Page 53
Figure 2-7. The Five Views of Architecture......Page 55
Figure 2-8. System View......Page 56
Figure 2-9. Subsystem View......Page 57
Figure 2-10. Component View......Page 58
Figure 2-11. Concurrency and Resource View......Page 59
Figure 2-12. Distribution View......Page 61
Figure 2-13. Safety and Reliability View......Page 64
2.3.5 Deployment View......Page 65
Figure 2-14. Deployment View......Page 66
2.4.1 Alphabet Soup: CORBA, UML, and MDA Basics......Page 67
2.4.2 MDA to the Rescue......Page 68
2.4.3.1 Basic Elements......Page 69
Figure 2-15. Container Pattern......Page 71
2.4.5 Concurrency and Resource View......Page 72
References......Page 73
3.2 The ROPES Development Process......Page 75
3.2.1 Why Process?......Page 76
Figure 3-1. Basic Elements of Process......Page 77
Figure 3-2. Key Enabling Technologies......Page 78
3.2.2.1.2 Model Execution......Page 79
Figure 3-3. Visual Model Execution and Test......Page 80
3.2.2.1.3 Model-Code Associativity......Page 81
3.2.2.1.4 Automated Requirements-Based Testing......Page 82
Figure 3-4. Incremental Development with Prototypes......Page 83
3.2.2.2 Process Timescales......Page 84
Figure 3-5. ROPES Spiral Macrocycle......Page 85
Figure 3-7. ROPES Nanocycle......Page 86
Figure 3-8. ROPES Semispiral Lifecycle......Page 87
3.2.4 Party!......Page 89
3.2.5.1 Requirements Analysis Phase......Page 90
3.2.5.2 Systems Engineering Phase......Page 91
3.2.6 Design with the ROPES Process......Page 92
3.2.6.3 Detailed Design Phase......Page 93
3.2.8 Test......Page 94
3.3.1 What Is a Design Pattern?......Page 95
3.3.2 Basic Structure of Design Patterns......Page 97
3.3.3 How to Read Design Patterns in this Book......Page 98
Figure 3-10. Pattern Hatching......Page 99
Figure 3-11. Pattern Mining......Page 100
Figure 3-12. Pattern Instantiation......Page 101
References......Page 102
Part II: Architectural Design Patterns......Page 103
References......Page 104
4.1.1 Abstract......Page 105
4.1.3 Pattern Structure......Page 106
4.1.6 Implementation Strategies......Page 107
Figure 4-4. ECG Collaboration......Page 108
Figure 4-5. Five-Layer Architecture Pattern Structure......Page 109
4.2.4 Collaboration Roles......Page 110
Figure 4-6. Ventilator Example Domains......Page 111
4.3.3 Pattern Structure......Page 112
4.3.4 Collaboration Roles......Page 113
4.3.6 Implementation Strategies......Page 114
Figure 4-8. nanoOS Model......Page 115
Figure 4-9. Channel Architecture Pattern Structure......Page 116
4.4.4 Collaboration Roles......Page 117
4.4.7 Related Patterns......Page 118
Figure 4-10. ECG Monitor Channel Pattern Example......Page 119
Figure 4-11. Recursive Containment Pattern Structure......Page 120
4.5.6 Implementation Strategies......Page 121
Figure 4-13. Spacecraft Subsystem Model......Page 122
Figure 4-15. Mapping Decomposed Use Cases to Subsystems......Page 123
Figure 4-16. Spacecraft Subsystem Details......Page 124
Figure 4-17. Hierarchical Control Pattern Structure......Page 125
4.6.5 Consequences......Page 126
4.6.8 Sample Model......Page 127
4.7.1 Abstract......Page 128
Figure 4-19. Virtual Machine Pattern Structure......Page 129
4.7.4 Collaboration Roles......Page 130
4.7.6.1 Reusability of the Virtual Machine......Page 131
4.7.6.2 Interacting with the Underlying Platform......Page 132
4.7.6.5 Debugging the Testing Facilities......Page 133
4.8.1 Abstract......Page 134
4.8.4 Collaboration Roles......Page 135
4.8.5 Consequences......Page 136
4.8.6 Implementation Strategies......Page 137
Figure 4-21. Control System Sample Model......Page 138
Figure 4-22. Initialization of Display Objects Sequence Diagram......Page 139
4.9 ROOM Pattern......Page 140
Figure 4-23. ROOM Pattern Structure......Page 141
4.9.5 Consequences......Page 142
4.9.8 Sample Model......Page 143
Figure 4-25. ROOM Pattern Example Statechart Model......Page 144
References......Page 146
Figure 5-1. Using ?active? Objects......Page 147
Figure 5-2. The Mutual Exclusion Problem......Page 149
Figure 5-3. Message Queuing Pattern......Page 150
5.3.5 Consequences......Page 151
Figure 5-4. Message Queuing Pattern Example......Page 152
5.4 Interrupt Pattern......Page 153
Figure 5-6. Interrupt Handling Methods......Page 154
5.4.4 Collaboration Roles......Page 155
5.4.6 Implementation Strategies......Page 156
Figure 5-7. Interrupt Pattern Example......Page 157
Figure 5-8. Guarded Call Pattern......Page 158
5.5.4 Collaboration Roles......Page 159
5.5.6 Implementation Strategies......Page 160
Figure 5-9. Guarded Call Pattern Example......Page 161
5.6.3 Pattern Structure......Page 163
Figure 5-11. Thread Barrier Synch Policy Statechart......Page 164
Figure 5-12. Rendezvous Pattern Example......Page 165
5.7.2 Problem......Page 166
5.7.4 Collaboration Roles......Page 167
5.7.7 Related Patterns......Page 168
5.8.1 Abstract......Page 169
5.8.4 Collaboration Roles......Page 170
5.8.6 Implementation Strategies......Page 171
Figure 5-16. Round Robin Pattern Example......Page 172
5.9.1 Abstract......Page 173
Figure 5-17. Static Priority Pattern......Page 174
5.9.4 Collaboration Roles......Page 175
5.9.6 Implementation Strategies......Page 177
Figure 5-18. Static Priority Pattern Example......Page 178
Figure 5-19. Dynamic Priority Pattern......Page 180
5.10.4 Collaboration Roles......Page 181
5.10.5 Consequences......Page 182
Figure 5-20. Dynamic Priority Pattern Example......Page 183
References......Page 184
6.2.2 Problem......Page 186
Figure 6-1. Static Allocation Pattern......Page 187
6.2.5 Consequences......Page 188
Figure 6-2. Static Allocation Pattern Example......Page 189
6.3.1 Abstract......Page 190
6.3.4 Collaboration Roles......Page 191
Code Segment 6-1: C++ Pooled Allocation Implementation Strategy......Page 192
Code Segment 6-2: Java Implementation Strategy for Pools......Page 193
Figure 6-4. Pooled Allocation Pattern Example......Page 194
6.4 Fixed Sized Buffer Pattern......Page 195
Figure 6-5. Fixed Sized Buffer Pattern......Page 196
6.4.4 Collaboration Roles......Page 197
Figure 6-6. Fixed Sized Buffer Pattern Example......Page 198
6.5.1 Abstract......Page 199
Figure 6-7. Smart Pointer Pattern......Page 200
6.5.4 Collaboration Roles......Page 201
Figure 6-8. Smart Pointer Cycles......Page 202
Figure 6-9. Smart Pointer Pattern Example......Page 203
6.6.1 Abstract......Page 204
6.6.4 Collaboration Roles......Page 205
6.6.5 Consequences......Page 206
Figure 6-11. Garbage Collection Pattern......Page 207
Figure 6-12. Garbage Collection Pattern Example Scenario......Page 208
6.7.3 Pattern Structure......Page 209
6.7.4 Collaboration Roles......Page 210
6.7.5 Consequences......Page 211
Figure 6-14. Garbage Compactor Pattern......Page 212
Figure 6-15. Garbage Compactor Pattern Example Scenario......Page 213
References......Page 214
7.1 Introduction......Page 215
Figure 7-1. Task Blocking [1]......Page 216
Figure 7-2. Unbounded Task Blocking......Page 217
Figure 7-3. Deadlock......Page 219
Figure 7-4. Critical Section Pattern......Page 220
7.2.4 Collaboration Roles......Page 221
Figure 7-5. Critical Section Pattern Example......Page 222
7.3.4 Collaboration Roles......Page 224
Figure 7-8. Priority Inheritance Pattern......Page 226
Figure 7-9. Priority Inheritance Pattern......Page 228
Figure 7-10. Highest Locker Pattern......Page 230
7.4.4 Collaboration Roles......Page 231
7.4.5 Consequences......Page 232
Figure 7-11. Highest Locker Pattern......Page 233
Figure 7-12. Priority Ceiling Pattern......Page 235
Figure 7-13. Priority Ceiling Pattern Resource Algorithm......Page 236
7.5.4 Collaboration Roles......Page 237
Figure 7-14. Priority Ceiling Pattern......Page 239
Figure 7-15. Simultaneous Locking Pattern......Page 241
7.6.4 Collaboration Roles......Page 242
7.6.5 Consequences......Page 243
Figure 7-16. Simultaneous Locking Pattern......Page 244
Figure 7-17. Ordered Locking Pattern......Page 246
7.7.4 Collaboration Roles......Page 247
7.7.6 Implementation Strategies......Page 248
Figure 7-18. Ordered Locking Pattern......Page 249
References......Page 251
8.1 Introduction......Page 252
8.2.1 Abstract......Page 253
8.2.4 Collaboration Roles......Page 254
Figure 8-2. Shared Memory Pattern......Page 256
Figure 8-3. Remote Method Call Pattern......Page 258
8.3.4 Collaboration Roles......Page 259
8.3.6 Implementation Strategies......Page 260
8.3.8 Sample Model......Page 261
Figure 8-5. Remote Method Call Scenario......Page 262
8.4.1 Abstract......Page 263
Figure 8-6. Observer Pattern......Page 264
8.4.4 Collaboration Roles......Page 265
8.4.6 Implementation Strategies......Page 266
Figure 8-7. Observer Pattern Example......Page 267
8.5 Data Bus Pattern......Page 268
Figure 8-8. Data Bus Pattern (Pull Version)......Page 269
Figure 8-9. Data Bus Pattern (Push Version)......Page 270
8.5.4 Collaboration Roles......Page 271
8.5.7 Related Patterns......Page 274
Figure 8-10. Data Bus Pattern Example Structure......Page 275
Figure 8-11. Data Bus Pattern Example Scenario......Page 276
8.6 Proxy Pattern......Page 277
Figure 8-12. Proxy Pattern......Page 278
8.6.4 Collaboration Roles......Page 279
8.6.6 Implementation Strategies......Page 280
Figure 8-13. Proxy Pattern Example Structure......Page 281
Figure 8-14. Proxy Pattern Example Scenario......Page 282
Figure 8-15. Broker Pattern......Page 284
8.7.4 Collaboration Roles......Page 285
8.7.6 Implementation Strategies......Page 287
Figure 8-17. Broker Pattern......Page 288
References......Page 289
9.1 Introduction......Page 291
9.1.1 Handling Faults......Page 292
9.2.1 Abstract......Page 293
9.2.4 Collaboration Roles......Page 294
9.2.5 Consequences......Page 295
Figure 9-3. Protected Single Channel Pattern Example......Page 296
9.3.1 Abstract......Page 297
9.3.4 Collaboration Roles......Page 298
Figure 9-5. Homogeneous Redundancy Pattern Example......Page 300
9.4.1 Abstract......Page 301
9.4.4 Collaboration Roles......Page 302
9.4.6 Implementation Strategies......Page 303
Figure 9-7. Triple Modular Redundancy Example......Page 304
9.5.2 Problem......Page 305
9.5.4 Collaboration Roles......Page 306
9.5.6 Implementation Strategies......Page 307
Figure 9-9. Heterogeneous Redundancy Pattern Example......Page 308
9.6.4 Collaboration Roles......Page 309
9.6.6 Implementation Strategies......Page 311
Figure 9-11. Monitor-Actuator Example......Page 312
Figure 9-12. Sanity Check Pattern......Page 313
9.7.4 Collaboration Roles......Page 314
9.7.8 Sample Model......Page 315
9.8.2 Problem......Page 316
Figure 9-15. Watchdog State Machine......Page 317
9.8.4 Collaboration Roles......Page 318
9.8.6 Implementation Strategies......Page 319
Figure 9-16. Watchdog Pattern Example......Page 320
Figure 9-17. Safety Executive Pattern......Page 321
9.9.4 Collaboration Roles......Page 322
Figure 9-18. Safety Executive Pattern Example......Page 324
References......Page 325
Parameterized Class......Page 327
Aggregation and Composition......Page 328
Generalization and Specialization......Page 329
Stereotypes and Classifiers......Page 330
Message Syntax......Page 331
Advanced Sequence Diagrams......Page 332
Use Case Relationships......Page 333
Deployment Diagram......Page 334
Package diagram......Page 335
State icon......Page 336
Sequential substates......Page 337
Pseudostates......Page 338
Submachines......Page 339
Activity Diagrams......Page 340
Appendix B. Pattern Index......Page 342