1 Introduction ................................................. 1
1.1 Starting with an Example ................................ 1
1.2 Definition of Persistent Objects and the Scope of this
Book .................................................... 4
1.3 Pointers and References ................................. 8
1.4 Persistent Objects as a Light-Weight Database .......... 11
1.5 Languages with Built-in Persistence .................... 16
2 Fundamentals of Persistence ................................. 37
2.1 Algorithms and Techniques .............................. 40
2.2 Memory Paging .......................................... 70
2.3 File Mapping ........................................... 81
2.4 Persistent Pointers .................................... 86
2.5 Quasi-Single Page (QSP) ................................ 95
3 Data Structures, Patterns, and UML ......................... 109
3.1 Basic Facts About Data Structures ..................... 110
3.2 Inserting Pointers with Inheritance ................... 138
3.3 Library of Design Patterns ............................ 142
3.4 Complexity and Errors ................................. 147
3.5 DB Schema and UML Class Diagram ....................... 154
3.6 Intrusive Data Structures with Aspects ................ 156
3.7 Conclusion ............................................ 161
4 Advanced Features, Schema Migration ........................ 163
4.1 Schema Migration ...................................... 163
4.2 Extensible Property ................................... 167
4.3 Multi-user Access, Data over Networks ................. 169
4.4 Address Space Layout Randomization (ASLR) ............. 170
4.5 Flash Memories, Smart Phones .......................... 172
5 Languages, Their Features and Limitations .................. 175
5.1 Plain Old С Language .................................. 176
5.2 С++ Language .......................................... 182
5.3 Java Language ......................................... 187
5.4 C# Language ........................................... 188
5.5 Objective-C Language .................................. 189
5.6 Errors and Debugging .................................. 198
6 Automatic Persistence for Objective-C ...................... 201
Jiri Soukup, Raj Lokanath, and Martin Soukup
6.1 Practical Guide to QSP Persistence .................... 202
6.2 Technical Notes on Objective-C Implementation ......... 206
6.3 Testing QSP on iPhone ................................. 217
6.4 Converting Existing Libraries ......................... 217
7 Benchmark .................................................. 223
7.1 History of this Benchmark ............................. 223
7.2 Persistent Systems Tested ............................. 225
7.3 Description of the Benchmark .......................... 227
7.4 Monitored Data ........................................ 228
7.5 Specifics of Individual Technologies .................. 229
7.6 Benchmark Rules ....................................... 231
7.7 Testing Details ....................................... 231
7.8 Results ............................................... 235
7.9 Improvements .......................................... 241
8 Proposal to Add a Keyword to All OO Languages .............. 245
Jiri Soukup and Martin Soukup
8.1 The New Keyword ....................................... 246
8.2 Generic Design Patterns ............................... 247
8.3 Example of Using the New Features for Generic
Data Structures ....................................... 248
8.4 Associations and Existing Class Libraries ............. 249
9 The Future ................................................. 251
9.1 New Programming Paradigm .............................. 251
9.2 What Can Be Improved .................................. 254
9.3 Unfinished Business ................................... 254
References ................................................. 257
Index ......................................................... 261
|