Implementing Architecture Stratification
Total Page:16
File Type:pdf, Size:1020Kb
Implementing Architecture Stratification Vom Fachbereich Informatik der Technischen Universit¨atDarmstadt zur Erlangung des akademischen Grades eines Doktor-Ingenieurs (Dr.-Ing.) genehmigte Dissertation von Diplom-Informatiker Martin Girschick geboren in Darmstadt Referent Prof. Dr. Thomas K¨uhne Korreferent Prof. Dr. Andy Sch¨urr Tag der Einreichung 26. August 2010 Tag der m¨undlichen Pr¨ufung 13. Oktober 2010 Darmstadt 2010 D17 2 3 Abstract Although currently software development often separates the design phase from the implementation, the trend towards model-driven approaches is undeniable. As models are the primary development artifact in model-driven development, one has to deal with the problems surrounding huge and therefore unmanageable models. To tackle these issues, systems are often divided into components that are modeled separately. As an alternative, views can be used, which hide certain aspects of the model or present them in a different form. In both cases, several models or at least several views co-exist, which leads to the problem of model synchronization. One of the main goals of model-driven development is the automatic generation of executable applications. Here, too, model synchronization is problematic, as several information sources may affect the same code fragment. When only parts of the system are generated, the remaining application has to be coded by hand, which complicates the reapplication of the generation process. In order to achieve a high level of automation in model-driven development, the complete application has to be modeled. In this scenario, the use of several models improves understandability and precision but again leads to model synchronization issues. In this dissertation I extend and concretize the ideas presented in [AK00] and [AK03]. In [AK00] Atkinson and K¨uhneintroduced the concept of stratified architectures. With it, software systems are described by a number of strata with decreasing levels of abstraction. Each stratum introduces a concern and thereby concretizes the system description. This strict ordering limits dependencies to adjacent strata. In [AK03] the authors complement the concept by using annotations to describe each concern. By introducing “refinement transformations", which implement abstractly described concerns, annotations enable stepwise refinement for model based system development and|in addition|alleviate the aforementioned model synchronization issue. In my thesis I discuss similar approaches and compare them to architecture stratifica- tion. Additionally, I present a complete implementation of the stratification concept and verify its effectiveness by applying it to a real-world project. The central element 4 is a combined graphical and textual model transformation language, which optimally fits the needs for stepwise refinement in a model-driven environment. This language enables fine grained and highly parameterizable model transformations. They are organized in concern-oriented transformation rules and described using a detailed metamodel. The rules are presented using a notation, which employs activity dia- grams for the control flow and collaboration diagrams for the model transformation. The language also integrates a template-based code generation language and can be extended further by using hand-written code. It is integrated into a CASE tool and provides the ability to trace concerns and their implementations within a stratified architecture. 5 Zusammenfassung Obwohl in der Softwareentwicklung derzeit oft noch eine klare Trennung zwischen der Entwurfs- und Implementierungsphase besteht, ist dennoch der Trend zu mod- ellgetriebenen Ans¨atzenunverkennbar. Modelle sind ein prim¨aresEntwicklungsarte- fakt modellgetriebener Entwicklung, sie sind jedoch oftmals sehr umfangreich und deshalb schwer zu handhaben. Daher werden Softwaresysteme oft in Komponenten unterteilt und separat modelliert. Alternativ k¨onnenmehrere Ansichten verwen- det werden, die bestimmte Aspekte des Systems verstecken oder in anderer Form darstellen. In beiden F¨allenexistieren mehrere Modelle oder zumindest mehrere Ansichten, was zu dem Problem der Modellsynchronisation f¨uhrt. Eines der Hauptziele modellgetriebener Entwicklung ist die automatische Gener- ierung von ausf¨uhrbarenAnwendungen. Auch hier existiert das Problem der Modell- synchronisation, da mehrere Informationsquellen mitunter das selbe Codefragment beeinflussen. Falls nur Teile einer Anwendung generiert werden, muss der Rest durch handgeschriebenen Code erg¨anztwerden. Dies erschwert die erneute Durchf¨uhrung des Generierungsprozesses. Um einen hohen Automatisierungsgrad in der modellgetriebenen Entwicklung zu erreichen, muss die gesamte Anwendung modelliert werden. Bei diesem Ansatz verbessert die Verwendung mehrerer Modelle sowohl die Verst¨andlichkeit als auch die Genauigkeit, f¨uhrtjedoch erneut zum Problem der Modellsynchronisation. In dieser Dissertation erweitere und konkretisiere ich die Ideen aus [AK00] und [AK03]. Atkinson und K¨uhnestellen in [AK00] die Architekturstratifikation vor. Damit werden Softwaresysteme durch mehrere Straten mit fallendem Abstraktions- niveau beschrieben. Jedes Stratum f¨ugteinen Aspekt hinzu und konkretisiert damit die Systembeschreibung. Eine solche strikte Ordnung beschr¨anktAbh¨angigkeiten auf benachbarte Straten. Um die Aspekte zu beschreiben, erg¨anzendie Autoren in [AK03] das Konzept um Annotationen. Diese erm¨oglichen durch die Verwendung von \Verfeinerungstransformationen" die Implementierung abstrakt beschriebener Aspekte und damit eine schrittweise Verfeinerung. Hierdurch mildern sie auch das zuvor erw¨ahnte Problem der Modellsynchronisation. In meiner Arbeit diskutiere ich ¨ahnliche Ans¨atzeund vergleiche sie mit der Architek- 6 turstratifikation. Ich beschreibe eine vollst¨andigeImplementierung des Stratifika- tionskonzepts und zeige ihre Effektivit¨atdurch die Anwendung auf ein reales Projekt. Im Zentrum steht eine grafische und textuelle Modelltransformationssprache, die op- timal auf die Bed¨urfnisseder schrittweisen Verfeinerung in einem modellgetriebenen Umfeld abgestimmt ist. Diese Sprache erm¨oglicht feingranulare und hochgradig parametrisierbare Modelltransformationen, die in Transformationsregeln organisiert sind und sich an Aspekten orientieren. Ihre Beschreibung erfolgt durch ein detail- liertes Metamodell. Die Notation der Regeln erfolgt durch Aktivit¨atsdiagramme, zur Beschreibung des Ablaufs, und Kollaborationsdiagramme, f¨urdie Modelltrans- formationen. Die Sprache integriert dar¨uber hinaus eine vorlagenbasierte Code- generierungssprache und kann durch handgeschriebenen Code erweitert werden. Sie ist in einer CASE-Werkzeug integriert und bietet die M¨oglichkeit, Aspekte und ihre Implementierung innerhalb einer stratifizierten Architektur nachzuverfolgen. 7 Preface After finishing my diploma thesis the desire to do further research was still present. My field of expertise was an ideal match for a newly founded department at the Technische Universit¨atDarmstadt: Metamodeling and its Applications. It presented me with the opportunity to do research and teach at the same time. After starting my work it became clear, that balancing those two wouldn't be an easy task. The head of the department and thesis supervisor, Prof. Dr. Thomas K¨uhne,gave me the opportunity to choose my own research subject. I'd like to thank him for that as this is in research institutions not always the case. He also provided continued guidance during my research. After evaluating different directions I settled on extending a previous research sub- ject of Prof. K¨uhne.His work on architecture stratification provided an ideal basis for a broad research area. I focussed on model transformation, which is a major re- search topic within the TU Darmstadt real-time systems group lead by Prof. Dr. An- dreas Sch¨urr,who became the second reviewer for my thesis. I wrote several joined papers with Prof. K¨uhneand his detailed understanding of the research subject and his experience in writing papers was very helpful. He also reviewed|along with Prof. Sch¨urr|several drafts of my thesis. In addition to writing papers, well-rehearsed presentations are also very impor- tant. The real-time systems department and the software technology group lead by Prof. Dr. Mira Mezini organized regular seminars, in which I was able to present my work and get valuable feedback from the department members. During my research I supervised several study and diploma theses. All of them helped to improve the contents of my dissertation and I'm very lucky to have found students, who really enjoyed the subject and brought a lot additional input. My thanks go to Felix Klar, Daniel Bausch, Axel Schulz and Anouar Haha. Finally I would like to thank my wife Joyce Wittur for her support, especially for reading and correcting my thesis. Also my gratitude goes to my parents Emilie and Werner Girschick and to my friends Sven Kloppenburg, Falk Fraikin and Christoph M¨uller,who always encouraged me to go on. 8 Declaration The content of this dissertation is a product of the author's original work except where explicitly stated as otherwise. CONTENTS 9 Contents 1 Introduction 15 1.1 Model-Driven Software Development . 15 1.2 Author's Contribution . 16 1.3 Structure of the Dissertation . 17 1.4 List of Published Papers . 18 2 Trends in Software Development 21 2.1 Concepts . 21 2.2 Methodologies and Research Subjects . 22 2.2.1 Techniques to Address Separation of Concerns . 22 2.2.2 Patterns and Frameworks . 24 2.2.3 Domain-Specific Languages