PHD THESIS: ARQUITECTURAS MULTICAPA: ACERCANDO EL ˜ ´ DISENO A LA IMPLEMENTACION JOSE GARCIA-ALONSO DEPARTMENT OF COMPUTER AND TELEMATIC SYSTEMS ENGINEERING Conformity of the Supervisor: Signed: D. Juan Manuel Murillo Rodr´ıguez Associate Professor Department of Computer and Telematic Systems Engineering University of Extremadura 2014 To Isabel, for her unconditional support. To Adri´an, who makes it all worth it. Acknowledgement The journey to become PhD is not an easy one. Fortunately, I can say that I have enjoyed every little step of it, mostly thanks to the people who have accompanied me along it. I hope these paragraphs serve to show my gratitude to everyone who has supported me over this years. I still remember my first years as a computer science student at the University of Extremadura. Ialreadylovedcomputersandsoftwarebackthen,butIwasfortunate to meet a fantastic group of teachers, passionate about their work, that started to teach me the wonders of software engineering. These teacher had something in common, all of them belonged to the Quercus Software Engineering Group. In these early years I decided that, if the opportunity arose, I would become a member of the Quercus group. After being a member for seven years, I have not regretted that decision and I can only show my gratitude to all of the Quercus members for their continued support, and especially to its director Juan Hernandez. One of the best experiences I have had over these years has been the creation of Gloin. What started as a crazy idea has become a reality that has allowed me to develop new facets of my profession, to live a multitude of new experiences and, especially, tomeetandworkwithalotofwonderfulpeople. Thanksguysforsharing part of your lives with me. Usually, the development of a thesis is a lonely job. However, in my case I have been fortunate to have someone that have shared this journey with me from the beginning. If anyone knows all aspects of this journey, all the ups and downs, that’s Javier Berrocal. Without his support and company it would have been impossible ii to get here. I have no words to describe the gratitude to my supervisor Juan Manuel Murillo. We have been working together for almost ten years and in all this time I have not stopped learning from him. Working with him, not only allowed me to get here, but has taught me a more positive way of coping with challenges and difficulties and has made me a better professional and a better person. Thank you. Finally, none of this would have been possible without my family. My mother, who taught me to always have my feet on the ground and instilled in me the re- sponsibility needed to finish a PhD. My father, who taught me to have my mind on the stars and gave me the hunger for knowledge and the love for science needed to start a PhD. Isabel, who has understood and encouraged me in every decision, even in the most difficult for her, and has suffered all the negative aspects of this journey without complaining. Finally Adrian, who has suffered my constant absences, but has also given me the strength I needed to get here Infinite thanks. iii Abstract In the last years Extremadura has become a privileged location for software devel- opment companies. The low cost of living and the abundance of qualified workers have led several of the country’s leading development companies to create impor- tant distributed development centers in the region. Several collaborations made with these centers during the last years have allowed the authors of this thesis to work on the common problems they face. Specifically, this thesis started with a col- laboration project with the regional government of Extremadura and the company Indra Software Labs. The main goal of this project was to solve the problems affecting the regional government related with the architectural and technological variability that can be found in multi-layer applications. These problems were also aggravated by the high staff rotation suffered by the regional government. Companies like Indra, with distributed development center, shared these same problems. After analyzing the causes of these problems, related with the ever increasing complexity of software architectures and the fast pace of evolution of the develop- ment technologies, different approaches were studied to try to solve them. None of these proposals solved all the problems faced by the regional government, especially when taking into account the high staff rotation suffered by this organization. This lack of solutions led to the start of this thesis with the following goals: • To identify and organize the most common architectural decisions in the de- velopment of framework based multi-layer applications. • To simplify the use of design pattern and frameworks in the development of iv such applications. • To automatically generate an specific design of the applications tailored to the to the architectural decisions taken by the software architect starting from the requirements of the application. • To automatically generate a significant amount of the application source code. ThesegoalshavebeenachievedinthisthesisbypresentingArchLayer, adevelop- mentprocessdesignedtohelpsoftwarearchitectsanddevelopersofthesecompanies. The proposed process allows software architects to convert an initial design of an application, completely agnostic to the architecture or technology with which it will be implemented, into a specific design for a given multi-layer architecture and a set of development frameworks. ArchLayer is supported by an architectural deci- sions repository that contains the architectural knowledge needed to develop this kind of applications. Additionally, a framework information meta-model is used to gather the technical knowledge needed to correctly use development framewoks. Fi- nally, a set of model-to-model and model-to-text transformation is provided to help architects and developers during the development process. To validate the proposed process, it has been used by a software development companyinthedevelopmentoftwocommercialprojects. Thisvalidationhasproved the feasibility, completeness and the effort required to apply the contributions pre- sented in this thesis. v Resumen En los u´ltimos an˜os Extremadura se ha convertido en un enclave privilegiado para las empresas de desarrollo de software. El bajo coste de la vida y la abundancia de personal cualificado han llevado a varias de las empresas de desarrollo m´as impor- tantes del pais a instalar en la regi´on centros de desarrollo distribuidos. Diversas colaboraciones realizadas con estos centros durante los ultimos an˜os han permitido a los autores de esta tesis trabajar en los problemas habituales en este contexto. En concreto, esta tesis comenz´o como un proyecto de colaboraci´on entre el gobierno auton´omico de Extremadura y la empresa Indra Software Labs. El objetivo principal de este proyecto consist´ıa en solucionar los problemas que afectaban al gobierno auton´omico relacionados con la variabilidad arquitect´onica y tecnol´ogica presente en las aplicaciones multicapa. Estos problemas eran empeora- dos por la elevada rotaci´on de personal sufrida por el gobierno regional. Empresas como Indra sufr´ıan los mismos problemas en sus centros de desarrollo distribuidos. Tras analizar las causas de estos problemas, relacionadas con la siempre creciente complejidad de las arquitecturas software y el elevado ritmo de evoluci´on de las tecnolog´ıas de desarrollo, se estudiaron varias propuestas para tratar de resolverlos. Ninguna de estas propuestas permit´ıan solventar todos los problemas abordadods, especialmente si se ten´ıa en cuenta la elevada rotaci´on de personal sufrida por dicha organizaci´on. Esta falta de soluciones llev´o al inicio de esta tesis con los siguientes objetivos: • Identificar y organizar las decisiones arquitect´onicas m´as comunes para el de- sarrollo de aplicaciones multicapa basadas en frameworks. vi • Simplificar el uso de patrones de disen˜o y frameworks de desarrollo en el de- sarrollo de este tipo de aplicaciones. • Generar autom´aticamente un disen˜o especifico de la aplicaci´on adaptado a las decisiones arquitect´onicas tomadas por el arquitecto a partir de los requisitos de la aplicaci´on. • Generar automaticamente una parte significativa del c´odigo fuente de la apli- caci´on. Estos objetivos se cumplen en esta tesis con la presentaci´on de ArchLayer, un proceso de desarrollo disen˜ado para ayudar a los arquitectos y desarrolladores de este tipo de compan˜´ıas. El proceso propuesto permite convertir un disen˜o inical de una aplicaci´on, completamente agn´ostico de la arquitectura o tecnolog´ıas con la que se va a implementar, en un disen˜o especifico para una arquitectura concreta y un conjunto de frameworks de desarrollo. ArchLayer se basa en un repositorio de decisionesarquitect´onicasquecontieneelconocimientoarquitect´oniconecesariopara desarrollarestetipodeaplicaciones. Adicionalmente,unmetamodelodeinformaci´on de los frameworks es utilizado para recopilar el conocimiento t´ecnico necesario para utilizar correctamente los frameworks de desarrollo. Por u´ltimo, se proporciona un conjunto de transformaciones modelo a modelo y modelo a texto para ayudar al arquitecto y a los desarrolladores durante el proceso de desarrollo. Para validar el proceso propuesto, este ha sido utilizado por una compan˜´ıa de desarrollo software en el desarrollo de dos proyectos comerciales. Esta validaci´on ha permitido comprobar la viabilidad, la completitud y el esfuerzo requerido para aplicar las contribuciones presentadas en esta tesis. vii Contents List of Figures xiii List of Tables xv List of Code Listings xvi 1 Introduction 1 1.1 Thesis origins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Research context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.3.1 Multi-layer architectures problems . . . . . . . . . . . . . . . 6 1.3.2 Development framework problems . . . . . . . . . . . . . . . 7 1.3.3 Distributed development problems and competitiveness in the software development industry . . . . . . . . . . . . . . . . . 8 1.3.4 Final outcome . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4 Thesis goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.5 Proposed solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.6 Thesis context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.6.1 Research projects . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.6.2 Publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1.6.3 Collaborations . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.7 Structure of this dissertation . . . . . . . . . . . . . . . . . . . . . . 18 2 Related work 20 2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 viii CONTENTS 2.2 Model-Driven engineering . . . . . . . . . . . . . . . . . . . . . . . . 21 2.2.1 Foundation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.2 Web engineering . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.2.3 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.3 Development frameworks . . . . . . . . . . . . . . . . . . . . . . . . 39 2.3.1 J2EE Development Frameworks . . . . . . . . . . . . . . . . . 40 2.3.2 Server-centric Web frameworks . . . . . . . . . . . . . . . . . 41 2.3.3 Programmer Questions about Framework . . . . . . . . . . . 42 2.3.4 Framework Usage Templates . . . . . . . . . . . . . . . . . . 43 2.3.5 Framework Specific Modeling Languages . . . . . . . . . . . . 44 2.3.6 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2.4 Variability management and architectural decisions . . . . . . . . . . 46 2.4.1 Variability management . . . . . . . . . . . . . . . . . . . . . 47 2.4.2 Architectural decisions . . . . . . . . . . . . . . . . . . . . . . 48 2.4.3 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 2.5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 3 ArchLayer: Bridging the gap between design and implementation 53 3.1 ArchLayer overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3.1.1 Running example . . . . . . . . . . . . . . . . . . . . . . . . . 57 3.1.2 Marking the initial design with quality attributes . . . . . . . 58 3.1.3 Modeling architectural variability . . . . . . . . . . . . . . . . 61 3.1.4 Choosing the application layers . . . . . . . . . . . . . . . . . 64 3.1.5 Tailoring the design to a multi-layer architecture . . . . . . . 66 3.1.6 Choosing design patterns and technologies . . . . . . . . . . . 67 3.1.7 Relating the chosen architecture and the system model. . . . 71 3.1.8 Additional technological information . . . . . . . . . . . . . . 72 3.1.9 From multi-layer to framework-based . . . . . . . . . . . . . . 73 3.1.10 Code generation . . . . . . . . . . . . . . . . . . . . . . . . . 75 3.2 Marked design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 3.2.1 Annotating the initial dessign . . . . . . . . . . . . . . . . . . 76 3.3 Architectural decisions repository . . . . . . . . . . . . . . . . . . . . 79 ix
Description: