Flexible Heterogeneous Software Systems Ter Verkrijging Van De
Total Page:16
File Type:pdf, Size:1020Kb
Flexible Heterogeneous Software Systems ACADEMISCH PROEFSCHRIFT ter verkrijging van de graad van doctor aan de Universiteit van Amsterdam op gezag van de Rector Magnificus prof. mr. P.F. van der Heijden ten overstaan van een door het college voor promoties ingestelde commissie, in het openbaar te verdedigen in de Aula der Universiteit op donderdag 1 februari 2007, te 10.00 uur door Hayco Alexander de Jong geboren te Zaandam Promotor: prof. dr. P. Klint Co-promotor: prof. dr. M.G.J. van den Brand Faculteit: Natuurwetenschappen, Wiskunde en Informatica The work in this thesis has been carried out at Centrum voor Wiskunde en Informa- tica (CWI) in Amsterdam under the auspices of the research school IPA (Institute for Programming research and Algorithmics). Acknowledgements First of all I would like to thank Paul Klint for his constructive and inspiring men- torship. You were always there to discuss any research ideas, and helped me (re-)focus when I got lost in my own train of thoughts, without ever giving me the feeling I was forced to see things your way. Thank you for giving me both the guidance and the freedom I needed to complete this thesis! Next I thank Mark van den Brand who, through his own perseverance, motivated me to go on at times when I was ready to pull the plug. Your ongoing desire to extend and improve the Meta-Environment ultimately sparked my ideas for the current plug-in architecture. Also, you and your wife Jose´ made the best kinderboerderij stew I ever had! ;-) I would like to thank the members of the reading committee for reading this thesis and for providing valuable feedback: prof. dr. Uwe Aßmann, prof. dr. Jan Bergstra, prof. dr. Martin Kersten, prof. dr. ir. Koos Rooda, prof. dr. Hans van Vliet. Many thanks also to Albert Hofkamp for thoroughly reading my thesis, and giving me valuable feedback. My friendship with Pieter Olivier has grown during my thesis years in many ways. In a professional way, together with Maud Olivier-Weddepohl, we are now real busi- ness partners. But I also enjoyed all the social things we shared, such as our interest in gaming and hiking. For the completion of this thesis we have shared many motivating talks while exploring and enjoying the wonderful Veluwe at the same time. Thanks for all your support so far, and may our way of life and view on matters remain as compatible for many years to come, as they are now! Had I not met Taeke Kooiker at CWI, the computer I used to write this thesis would have been another MyCom product. Instead, I now know exactly how to build (and have built) my own computer from various hardware components. Not only have we spent many hours working together on SEN1 software, we also shared many exciting discussions on other topics, all of which I really enjoyed, and which have enriched my life. In the past six years at CWI, many people have at some point been part of the SEN1 research group. They have all contributed in one way or another to my thesis. Discussions in the hallway, sharing research views over lunch, having cake and coffee together, (re-)using each others software. The open and harmonious way we worked together in SEN1, with ample room for constructive criticism, has always inspired and motivated me very much. iii Finally, I want to thank all the people who are not directly related to the making of this thesis, but who have endured my antics, who had to put up with my bad moods, had their friendships temporarily suspended while I wrestled with myself, and for enduring other Haycoisms. I want to thank my Mom for her unfailing support during these thesis years, and my close friends Eggie van Buiten, Jean-Pierre Nibbelink, Maud Weddepohl (err, Olivier), Ruben Laane, and Meriam Nibbelink for being there when I needed them — each in their own way. Thanks! iv Contents I Overview 1 1 Introduction 3 1.1 Softwarere-use ............................. 3 1.1.1 SoftwareArchitecture . 4 1.1.2 Component-based software engineering . 6 1.1.3 Middleware........................... 6 1.1.4 SoftwareProductlines . 7 1.1.5 Variability............................ 8 1.2 The Decoupling Paradox . 9 1.2.1 TheUNIXpipeline....................... 9 1.2.2 The ToolBus coordination architecture . 11 1.3 ResearchContext ............................ 12 1.4 ResearchQuestions ........................... 13 1.5 RelatedWork .............................. 14 1.6 OutlineandOriginoftheChapters . 14 1.7 AbouttheImplementations . 15 II Structuring Component Data 17 2 ATerms 19 2.1 Introduction............................... 19 2.2 ATermsataGlance ........................... 20 2.2.1 TheATermDataType . 20 2.2.2 OperationsonATerms . 22 2.3 Implementation ............................. 24 2.3.1 Requirements.......................... 24 2.3.2 MaximalSharing ........................ 25 2.3.3 GarbageCollection. 26 2.3.4 TermEncoding ......................... 28 2.3.5 ATerm Exchange: the Binary ATerm Format . 31 v 2.4 Performance Measurements . 33 2.4.1 Benchmarks........................... 33 2.4.2 Measurements ......................... 35 2.4.3 Summary of Measurements . 39 2.5 Applications............................... 39 2.5.1 Representing Syntax Trees: AsFix and CasFix . 39 2.5.2 ASF+SDF Meta-Environment . 41 2.5.3 ASF+SDF to C compiler . 42 2.5.4 OtherApplications . 42 2.6 Discussion................................ 43 2.6.1 RelatedWork.......................... 43 2.6.2 History ............................. 46 2.6.3 Conclusions........................... 46 3 Generation of Abstract Programming Interfaces from Syntax Definitions 47 3.1 Introduction............................... 47 3.1.1 RelatedWork.......................... 49 3.1.2 ASF+SDFinanutshell. 51 3.1.3 Annotated Terms: the ATerm syntax . 53 3.1.4 ASF+SDF Parse Trees for Dummies: AsFix explained . 53 3.2 Accessing ATerm Data Types . 55 3.2.1 Accessing ATerms using the Level One interface . 55 3.2.2 Accessing ATerms using the Level Two interface . 56 3.2.3 AccessingAsFixparsetrees . 57 3.2.4 Maintenanceissues. 58 3.3 From syntax to API ........................... 59 3.3.1 Deriving the ADT from a SDF specification . 61 3.4 Code generation from ADT toC .................... 62 3.4.1 Generated types and functions . 62 3.4.2 Implementation......................... 64 3.5 Software engineering benefits in the Meta-Environment . ....... 67 3.6 Conclusions............................... 69 3.7 Discussion................................ 69 3.8 Futurework............................... 70 III Structuring Component Interaction 71 4 ToolBus: the Next Generation 73 4.1 Generic Language Technology . 73 4.1.1 One Realization: the ASF+SDF Meta-Environment . 73 4.1.2 Towards a Component Based Architecture . 74 4.1.3 PlanofthisChapter. 75 4.2 TheToolBusArchitecture. 75 4.3 An Example: the Address Book Service . 76 4.3.1 ToolBus Processes for the Address Book Service . 79 vi 4.3.2 ToolBus Process for the User Interface . 81 4.4 Application to the ASF+SDF Meta-Environment . 82 4.5 Issues in a Next-Generation ToolBus . 84 4.5.1 Undisciplined Message Patterns . 84 4.5.2 ExceptionHandling . 86 4.5.3 Call-By-Value Versus Call-By-Reference . 87 4.5.4 Related Frameworks: Java RMI, RMI-IIOP and Java IDL . 88 4.6 CurrentStatus.............................. 92 4.7 ConcludingRemarks .......................... 93 5 My Favorite Editor Anywhere 95 5.1 Introduction............................... 95 5.1.1 Background........................... 96 5.1.2 Relatedwork .......................... 96 5.2 Design.................................. 97 5.2.1 Requirements and considerations . 97 5.2.2 Editor-independent design . 98 5.2.3 Editor-specificdesign. 98 5.2.4 Executionmodels. 99 5.3 Implementation ............................. 99 5.3.1 EditorMultiplexer . 99 5.3.2 EditorConnectors . 100 5.3.3 Glueingitalltogether . 102 5.4 DiscussionandFuturework . 103 6 Software System Extensibility 105 6.1 Introduction............................... 105 6.1.1 ResearchContext. 106 6.1.2 ResearchQuestions. 107 6.1.3 Overview ............................ 107 6.2 TheMozillaSoftwareSuite. 108 6.2.1 MozillaThemes ........................ 108 6.2.2 MozillaPlug-ins . 108 6.2.3 MozillaExtensions . 109 6.2.4 Summary ............................ 109 6.3 TheEclipseplatform . 110 6.3.1 Extension participants and roles . 110 6.3.2 Example ............................ 111 6.3.3 Summary ............................ 113 6.4 TheJavaPlug-inFramework . 114 6.4.1 Summary ............................ 114 6.5 Winamp................................. 114 6.5.1 WinampThemes ........................ 115 6.5.2 WinampPlug-ins . 115 6.5.3 Summary ............................ 116 6.6 Extension Mechanism Comparison . 116 vii 6.6.1 Decoration ........................... 117 6.6.2 Delegation ........................... 117 6.6.3 Mediation............................ 117 6.6.4 Adaptation ........................... 118 6.7 A Plug-in Architecture for the Meta-Environment . 118 6.7.1 Extension mechanisms in the Meta-Environment . 119 6.7.2 The Basic GUI Framework . 120 6.7.3 Example: simple clock . 123 6.7.4 Extension: Allowing communication to a plug-in . 123 6.7.5 Extension: Allowing communication from a plug-in . 124 6.7.6 Extension: Allowing inter-plug-in communication . 125 6.8 Current plug-ins in the Meta-Environment . 126 6.8.1 Someplug-instatistics . 131 6.8.2 The ERROR plug-ininterface . 131 6.8.3 Plug-in interaction in the Meta-Environment . 133 6.9 Summary and Conclusions . 137 6.9.1 Plug-in Techniques . 137 6.9.2 Plug-ininteraction . 138 6.9.3 The ToolBus in a Plug-in Framework . 138 6.9.4 Impact on the ASF+SDF Meta-Environment . 138 6.9.5 Contributions .......................... 140 IV Conclusion 141 7 Conclusions 143 7.1 Space efficient, type-safe data exchange . 143 7.2 Building an IDE using a coordination architecture . 144 7.2.1 Component coordination techniques for an IDE . 144 7.2.2 Using off-the-shelf components in a robust way . 145 7.2.3 A central GUI for decoupled components . 145 7.2.4 ApplicabilityConsiderations . 146 7.3 FutureWork............................... 146 7.3.1 Applicationwidetype-safety. 146 7.3.2 About ToolBus and plug-ins . 150 A Syntax and Interface of ATerms 153 A.1 Concrete Syntax of ATerms .