Restful Web Services Development with a Model-Driven Engineering Approach

Total Page:16

File Type:pdf, Size:1020Kb

Restful Web Services Development with a Model-Driven Engineering Approach RESTful Web Services Development with a Model-Driven Engineering Approach RAFAEL CORVEIRA DA CRUZ GONÇALVES Julho de 2018 Instituto Superior de Engenharia do Porto RESTful Web Services Development with a Model- Driven Engineering Approach 1130837, Rafael Gonçalves Dissertation to obtain the Master Degree in Informatics Engineering, Area of Expertise in Software Engineering Porto, july 2018 Instituto Superior de Engenharia do Porto RESTful Web Services Development with a Model- Driven Engineering Approach 1130837, Rafael Gonçalves Dissertation to obtain the Master Degree in Informatics Engineering, Area of Expertise in Software Engineering Supervisor: Isabel Azevedo Porto, july 2018 RESTful Web Services Development with a Model-Driven Engineering Approach Abstract A RESTful web service implementation requires following the constrains inherent to Representational State Transfer (REST) architectural style, which, being a non-trivial task, often leads to solutions that do not fulfill those requirements properly. Model-driven techniques have been proposed to improve the development of complex applications. In model-driven software development, software is not implemented manually based on informal descriptions, but partial or completely generated from formal models derived from metamodels. A model driven approach, materialized in a domain specific language that integrates the OpenAPI specification, an emerging standard for describing REST services, allows developers to use a design first approach in the web service development process, focusing in the definition of resources and their relationships, leaving the repetitive code production process to the automation provided by model-driven engineering techniques. This also allows to shift the creative coding process to the resolution of the complex business rules, instead of the tiresome and error-prone create, read, update, and delete operations. The code generation process covers the web service flow, from the establishment and exposure of the endpoints to the definition of database tables. Key-words: Web service, Model driven engineering, OpenAPI, Resource, Domain specific language, RESTful i RESTful Web Services Development with a Model-Driven Engineering Approach ii RESTful Web Services Development with a Model-Driven Engineering Approach Resumo A implementação de serviços web RESTful requer que as restrições inerentes ao estilo arquitetónico “Representational State Transfer” (REST) sejam cumpridas, o que, sendo usualmente uma tarefa não trivial, geralmente leva a soluções que não atendem a esses requisitos adequadamente. Técnicas orientadas a modelos têm sido propostas para melhorar o desenvolvimento de aplicações complexas. No desenvolvimento de software orientado a modelos, o software não é implementado manualmente com base em descrições informais, mas parcial ou completamente gerado a partir de modelos formais derivados de meta-modelos. Uma abordagem orientada a modelos, materializada através de uma linguagem específica do domínio que integra a especificação OpenAPI, um padrão emergente para descrever serviços REST, permite aos desenvolvedores usar uma primeira abordagem de design no processo de desenvolvimento de serviços da Web, concentrando-se na definição dos recursos e das suas relações, deixando o processo de produção de código repetitivo para a automação fornecida por técnicas de engenharia orientadas a modelos. Isso também permite focar o processo de codificação criativo na resolução e implementação das regras de negócios mais complexas, em vez de nas operações mais repetitivas e propensas a erros: criação, leitura, atualização e remoção de dados. O processo de geração de código abrange o fluxo do serviço web desde o estabelecimento e exposição dos caminhos para os serviços disponíveis até à definição de tabelas de base de dados. Key-words: Serviço web, Engenharia orientada a modelos, OpenAPI, Recurso Linguagem específica do domínio, RESTful iii RESTful Web Services Development with a Model-Driven Engineering Approach iv RESTful Web Services Development with a Model-Driven Engineering Approach Table of contents List of figures ........................................................................................................... vii List of tables ............................................................................................................. ix List of code snippets .............................................................................................. xii Notation and Glossary ........................................................................................... xiv Chapter 1 .................................................................................................................... 1 Introduction.................................................................................................................. 1 1.1 Background and motivation ......................................................................................... 1 1.2 Objectives ................................................................................................................... 2 1.3 Case study .................................................................................................................. 2 1.4 Adopted methodology.................................................................................................. 3 1.5 Contribution to Knowledge .......................................................................................... 4 1.6 Thesis outline .............................................................................................................. 5 Chapter 2 .................................................................................................................... 7 Context ........................................................................................................................ 7 2.1 Problem and opportunities ........................................................................................... 7 2.2 Value analysis and proposition .................................................................................... 9 2.3 RESTful web services ............................................................................................... 19 2.4 Model-Driven Engineering ......................................................................................... 23 2.5 OpenAPI specification ............................................................................................... 24 Chapter 3 .................................................................................................................. 31 MDE in REST web services development ................................................................. 31 3.1 Related work - State of the Art ................................................................................... 31 3.2 Comparative analysis ................................................................................................ 36 3.3 Solution perspective .................................................................................................. 37 3.4 Requirements analysis .............................................................................................. 40 3.5 Adopted technologies ................................................................................................ 42 3.6 Solution evaluation methodology ............................................................................... 45 Chapter 4 .................................................................................................................. 53 DSL Design and implementation ............................................................................... 53 4.1 Common approach .................................................................................................... 53 4.2 Resource-oriented DSL ............................................................................................. 54 4.3 OAS-oriented DSL ..................................................................................................... 62 4.4 Code generation ........................................................................................................ 69 v RESTful Web Services Development with a Model-Driven Engineering Approach 4.5 Broad comparative analysis ....................................................................................... 82 Chapter 5 ................................................................................................................. 85 Solution Evaluation ................................................................................................... 85 5.1 DSLs usability ............................................................................................................ 85 5.2 Code metrics analysis ............................................................................................... 87 5.3 Web service QoS....................................................................................................... 92 Chapter 6 ................................................................................................................. 97 Conclusion and future work ...................................................................................... 97 6.1 Summary ................................................................................................................... 97 6.2 Goals achieved .......................................................................................................... 98 6.3
Recommended publications
  • Automatic Test Generation of REST Apis Automatiserad Testgenerering Av REST API
    Linköping University | Department of Computer and Information Science Master’s thesis, 30 ECTS | Datateknik 2020 | LIU-IDA/LITH-EX-A--20/068--SE Automatic Test Generation of REST APIs Automatiserad testgenerering av REST API Axel Karlsson Supervisor : Anders Fröberg Examiner : Erik Berglund External supervisor : Linus Lindholm Linköpings universitet SE–581 83 Linköping +46 13 28 10 00 , www.liu.se Upphovsrätt Detta dokument hålls tillgängligt på Internet - eller dess framtida ersättare - under 25 år från publicer- ingsdatum under förutsättning att inga extraordinära omständigheter uppstår. Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner, skriva ut enstaka ko- pior för enskilt bruk och att använda det oförändrat för ickekommersiell forskning och för undervis- ning. Överföring av upphovsrätten vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av dokumentet kräver upphovsmannens medgivande. För att garantera äktheten, säker- heten och tillgängligheten finns lösningar av teknisk och administrativ art. Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i den omfattning som god sed kräver vid användning av dokumentet på ovan beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan form eller i sådant sammanhang som är kränkande för upphovsman- nens litterära eller konstnärliga anseende eller egenart. För ytterligare information om Linköping University Electronic Press se förlagets hemsida http://www.ep.liu.se/. Copyright The publishers will keep this document online on the Internet - or its possible replacement - for a period of 25 years starting from the date of publication barring exceptional circumstances. The online availability of the document implies permanent permission for anyone to read, to down- load, or to print out single copies for his/hers own use and to use it unchanged for non-commercial research and educational purpose.
    [Show full text]
  • Xtext / Sirius - Integration the Main Use-Cases
    Xtext / Sirius - Integration The Main Use-Cases White Paper December 2017 SUMMARY Chapter 1 Introduction 1 Chapter 2 Let’s start 2 Chapter 2.1 What modeling is about? 2 Chapter 2.2 Benefits of graphical modeling 3 Chapter 2.3 Benefits of textual modeling 5 Chapter 3 What is Xtext? 6 Chapter 4 What is Sirius? 8 Chapter 5 Xtext & Sirius in action 10 Chapter 5.1 Case 1: Editing the same models both graphically and textually 10 Chapter 5.2 Case 2: Embedding an Xtext Editor into Sirius 15 Chapter 6 How may we help you? 18 Introduction Introduction You are going to create a domain-specific modeling tool and you wonder how users will edit and visualize the models: textually with a dedicated syntax and a rich textual editor ? or graphically with diagrams drawn with a palette and smart tools? Both approaches are interesting and can be used complementary: While text is able to carry more detailed information, a diagram highlights the relationship between elements much better. In the end, a good tool should combine both, and use each notation where it suits best. In this white paper, we will explain the benefits of each approach. Then we will present Eclipse Xtext and Eclipse Sirius, two open-source frameworks for the development of textual and graphical model editors. And finally, we will detailed two use-cases where these two technologies can be integrated in the same modeling workbench. 1 Let’s start Let’s start What modeling is about? Before presenting the graphical and textual modeling approaches, it is important to briefly clarify what we mean by modeling.
    [Show full text]
  • API Providers Guideанаapi Design
    API Providers Guide ­ API Design Prepared By Kin Lane June 2014 Table of Contents Overview of The API Design Space A New Generation Of API Design Developing The Language We Need To Communicate Leading API Definition Formats Building Blocks of API Design Companies Who Provide API Design Services API Design Tools API Design Editors API Definitions Providing A Central Truth For The API Lifecycle Contributing To The Deployment Lifecycle Contributing To The Management Lifecycle Contributing To The Testing & Monitoring Lifecycle Contributing To The Discovery Lifecycle An Evolutionary Period For API Design Overview of The API Design Space In the early days of APIs, everything was just about deploying and consuming—you were doing one or the other. Then by 2006 we saw the stabilization of common API management practices emerge from providers like Mashery, and then 3Scale. Now in 2014 we are stabilizing again, and the API universe is expanding around the area of API design, with new approaches, tools and entire companies emerging to provide services that are dedicated to helping companies design the best APIs they can. I define the world of API design as everything that goes into planning and designing your API, as well as the definition of your API that will eventually be deployed as your production endpoints, drive your documentation, generate the code samples your developers will use to integrate, test, monitor, and allow your API to be found­­through this lens, API design is fast becoming the driver for all areas of the API lifecycle. Depending on our needs, API design may begin with understanding HTTP, and REST, or may learning more about applying hypermedia as part of your design constraints, or API design might simply be about generating a Swagger definition, so you can generate interactive API documentation.
    [Show full text]
  • Galileo Release Train 2009
    Galileo Release Train 2009 1 6 Years in a Row 33 Projects 24 million LOC 23 Projects 18 million LOC 21 Projects 17 million LOC 10 Projects WTP BIRT TPTP TPTP EMF CDT VE CDT Ganymede Galileo Eclipse 3.0 Eclipse 3.1 Callisto Europa June 28 2004 June 28 2005 June 30 2006 June 29, 2007 June 25, 2008 June 24, 2008 2 Galileo Stats - 33 project teams - 24+ million LOC - 44 companies providing committers 3 Why a release train? Help spur commercial adoption of Eclipse technology Consumers use many projects not just the Platform Inter-dependency between projects Eclipse project teams are independent BUT the project code is inter-dependent. Alignment of version compatibility Remove latency between project releases 4 How did we make it happen? Architecture Modular & Extensible Architecture vs Monolithic Release Governance Projects remain independent Process Open source development process Frequent milestone releases 5 Key Themes Advancement in Eclipse Runtime Technology Growth of Eclipse Modeling Domain Specific Languages Expanding Enterprise Adoption 6 Eclipse Runtime Technology New Support for OSGi in Equinox Implementation of the new OSGi 4.2 specification Distributed OSGi services PDE Improvements OSGI Declarative Services tooling Publish to a p2 repository API Analysis Tools Target platform support in PDE Make it easier to develop software that runs on EclipseRT runtimes EclipseRT runtime SDKs available in Galileo repository PDE tooling P2 Provisioning Improvements More flexible UI for RCP applications New Publisher tool that make it easier to publish content to repositories 7 Modeling Domain Specific Languages Developers need to deal with a growing set of APIs APIs for different infrastructure services, standards, business standards, etc.
    [Show full text]
  • Eclipse Roadmap V5
    Eclipse RoadMap v5 Introduction As required by the Eclipse Development Process, this document describes the 2010 Eclipse Roadmap. There are three main sections to this document: 1. This Preamble provides some background on Eclipse and the Foundation, and identifies the strategic goals of Eclipse. It also provides a brief overview of the scope of future projects 2. The Themes and Priorities which has been developed by the Eclipse Councils. 3. The Platform Release Plan which has been developed by the Eclipse Planning Council. The Roadmap is intended to be a living document which will see future iterations. This document is the fifth version of the Eclipse Roadmap, and is labeled as version 5.0. In order to preserve this document while the underlying information evolves, the pages have been frozen by copying them from their original project hosted locations. The goal of the Roadmap is to provide the Eclipse ecosystem with guidance and visibility on the future directions of the Eclipse open source community. An important element in this visibility is that the Roadmap help the EMO and the Board of Directors in determining which projects will be accepted by Eclipse during the life of this revision of the Roadmap. In other words, new projects must be consistent with the Roadmap. This does not mean that every new project must be explicitly envisaged by the Roadmap. It does mean that new projects cannot be inconsistent with the stated directions of Eclipse. In particular, Eclipse expects that incubator projects created in the Technology PMC will cover areas not explicitly described in the Roadmap.
    [Show full text]
  • Flexible Graphical Editors for Extensible Modular Meta Models
    X perf =1.00 X loss =0.01 SDSoftware Design and Quality Flexible Graphical Editors for Extensible Modular Meta Models Master’s Thesis of B.Sc. Michael Junker at the Department of Informatics Institute for Program Structures and Data Organization (IPD) Reviewer: Prof. Dr. Ralf Reussner Second reviewer: Jun.-Prof. Dr.-Ing. Anne Koziolek Advisor: Dipl.-Inform. Misha Strittmatter Second advisor: M.Sc. Heiko Klare 12. April 2016 – 11. October 2016 Karlsruher Institut für Technologie Fakultät für Informatik Postfach 6980 76128 Karlsruhe I declare that I have developed and written the enclosed thesis completely by myself, and have not used sources or means without declaration in the text. Karlsruhe, 10.October 2016 .................................... (B.Sc. Michael Junker) Abstract In model-driven software development, graphical editors can be used to create model instances more eciently and intuitively than with pure XML code. These graphical editors rely on models created on the basis of a meta-model. If such a meta-model is extended invasively not only its code has to be re-generated but also the graphical editor needs to be adapted. When developing multiple extensions, the meta-model as well as the corresponding graphical editor tend to get complex and error-prone. One way of coping with this complexity is to use modular meta-models and extending them noninvasively. However, having multiple meta-model fragments providing extended features is only half the job as equivalent graphical editors are needed as well. This master’s thesis therefore analyzes dierent types of extensions for meta-models as well as on graphical editor level.
    [Show full text]
  • PRISM Model Checker As an Eclipse-Plugin
    MASARYK UNIVERSITY FACULTY}w¡¢£¤¥¦§¨ OF I !"#$%&'()+,-./012345<yA|NFORMATICS PRISM model checker as an Eclipse-plugin DIPLOMA THESIS Bc. Milan Malota Brno, Autumn 2015 Declaration Hereby I declare, that this paper is my original authorial work, which I have worked out by my own. All sources, references and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. In Brno, January 11, 2016 Bc. Milan Malota Advisor: RNDr. Vojtechˇ Rehˇ ak,´ Ph.D. ii Acknowledgement I would like to thank my advisor Vojtechˇ Rehˇ ak´ for valuable advice, com- ments, support and patience during the writing of this thesis. I also want to express my gratitude to my family and my girlfriend for their support during studies. iii Abstract PRISM is a probabilistic model checker and is used in many different ap- plication domains and is well known among scientists dealing with formal modeling and analysis of systems that exhibit random or probabilistic be- havior. PRISM’s GUI was developed in the beginning of the PRISM life cycle and technologies made great progress so it can seem obsolete. That is why the request for a new GUI was pronounced. One of the platforms suitable for integrating an application and preferred by the original development team is the Eclipse platform. In the scope of this thesis we analyze available Eclipse platforms and notable graphical user interface frameworks. On the basis of the analysis new graphical user interface allowing all funcionality of the current PRISM GUI is implemented. iv Keywords PRISM, Eclipse RCP, Eclipse e4, AWT, Swing, SWT, JFace, Albireo v Contents 1 Introduction ...............................3 1.1 Motivation .............................3 2 Preliminaries ..............................5 2.1 PRISM model checker ......................5 2.1.1 The PRISM language .
    [Show full text]
  • Next Gen Integration and API Economy
    WHITE PAPER NEXT GEN INTEGRATION AND API ECONOMY Executive Summary Industry leaders say that Integration is where developers are designing innovative All such ecosystems emerged slowly in the key to Digital Economy. APIs are the applications, reaching new customers and last few years, and monetized transactions foundation of Next Gen Integration, be it exploring new markets, all around APIs. on the APIs, which created new digital Cloud integration, Application integration, revenue streams, which in turn, led to API In an Enterprise Integration ecosystem, B2B integration or Enterprise Integration. economy. APIs help in exposing an enterprise’s In current context, APIs are simple backend-as-a-service so that new Businesses, both large and small, both B2C to understand interfaces focused on applications can quickly be built on top of and B2B, all participate in the API economy. business’ recognizable assets, that facilitate that. Why this works is because a significant This paper brings connectivity and integration with peer applications or useful data is almost locked inside big and integration into spotlight, showcasing the systems in an Agile manner. complex legacy enterprise systems, and entire journey that has taken place and the data warehouses, and APIs unlock that A new Developer Ecosystem is emerging pace it’s moving ahead in. data, that precious data. External Document © 2019 Infosys Limited External Document © 2019 Infosys Limited Introduction Traditional integration We live in an economy powered by digital Traditional integration methods are: 2. Hub and Spoke (H&S) computing technologies, cushioned by 1. Point to Point (P2P) 3. Enterprise Service Bus (ESB) the Internet and the World Wide Web.
    [Show full text]
  • Community-Based API Builder to Manage Apis and Their Connections with Cloud-Based Services
    Community-based API Builder to manage APIs and their connections with Cloud-based Services Romanos Tsouroplis1, Michael Petychakis1, Iosif Alvertis1, Evmorfia Biliri1, Fenareti Lampathaki1, Dimitris Askounis1 1 National Technical University of Athens, School of Electrical and Computer Engineering, Athens, Greece { rtsouroplis, mpetyx, alvertisjo, ebiliri, flamp, askous} @epu.ntua.gr Abstract. Creating added value, innovative applications and services in the web is hindered by the prevailing different formats and models of information retrieved by the various Cloud-based Services (CBS). Additionally, CBS tend to change their Application Programming Interface (API) versions very often, not sufficiently helping the interested enterprises with their adoption as they need to be up-to-date and always functional. The API Builder is a community- based platform that aims to facilitate developers in adopting a Graph API that unifies the experience of multiple cloud-based services APIs and personal cloudlets, building and maintaining their software applications easily, despite any changes made in the CBS APIs. Keywords: APIs, Cloud-based Services, Evolving APIs, Graph API, Community-based platform, Social Enterprise 1. Introduction These days, more and more users tend to share their data through the World Wide Web. Social Networks have gathered large silos of information for each of their users and their interconnections. The Web APIs (Application Programming Interface) provide all the endpoints needed for a developer to request access into this plethora of information. All the major social networks like Facebook, Twitter, etc., have an API, providing most of their core services to third parties for several reasons [1]. Currently, on the site Programmable Web, which indexes, categorizes and makes mashups of APIs, 12,987 public APIs are listed and this number is continuously growing [2].
    [Show full text]
  • Code Smell Prediction Employing Machine Learning Meets Emerging Java Language Constructs"
    Appendix to the paper "Code smell prediction employing machine learning meets emerging Java language constructs" Hanna Grodzicka, Michał Kawa, Zofia Łakomiak, Arkadiusz Ziobrowski, Lech Madeyski (B) The Appendix includes two tables containing the dataset used in the paper "Code smell prediction employing machine learning meets emerging Java lan- guage constructs". The first table contains information about 792 projects selected for R package reproducer [Madeyski and Kitchenham(2019)]. Projects were the base dataset for cre- ating the dataset used in the study (Table I). The second table contains information about 281 projects filtered by Java version from build tool Maven (Table II) which were directly used in the paper. TABLE I: Base projects used to create the new dataset # Orgasation Project name GitHub link Commit hash Build tool Java version 1 adobe aem-core-wcm- www.github.com/adobe/ 1d1f1d70844c9e07cd694f028e87f85d926aba94 other or lack of unknown components aem-core-wcm-components 2 adobe S3Mock www.github.com/adobe/ 5aa299c2b6d0f0fd00f8d03fda560502270afb82 MAVEN 8 S3Mock 3 alexa alexa-skills- www.github.com/alexa/ bf1e9ccc50d1f3f8408f887f70197ee288fd4bd9 MAVEN 8 kit-sdk-for- alexa-skills-kit-sdk- java for-java 4 alibaba ARouter www.github.com/alibaba/ 93b328569bbdbf75e4aa87f0ecf48c69600591b2 GRADLE unknown ARouter 5 alibaba atlas www.github.com/alibaba/ e8c7b3f1ff14b2a1df64321c6992b796cae7d732 GRADLE unknown atlas 6 alibaba canal www.github.com/alibaba/ 08167c95c767fd3c9879584c0230820a8476a7a7 MAVEN 7 canal 7 alibaba cobar www.github.com/alibaba/
    [Show full text]
  • Developing User Interfaces with EMF Parsley
    Developing User Interfaces with EMF Parsley Lorenzo Bettini∗ Dipartimento di Informatica, Universita` di Torino, Torino, Italy Keywords: EMF, Modeling, Eclipse, User Interface, DSL. Abstract: In this paper we describe the main features of EMF Parsley, a new Eclipse project for implementing appli- cations based on the Eclipse Modeling Framework (EMF). EMF Parsley aims at complementing the EMF reflective mechanisms with respect to rapidly creating user interfaces based on models, without having to deal with internal details and setup code. In particular, EMF Parsley uses injection mechanisms to easily customize all the aspects of such applications. Moreover, it provides a set of reusable user interface components like trees, tables and detail forms that manage the model with the introspective EMF capabilities, together with reusable views, editors and dialogs. Besides project wizards, to easily create projects based on EMF Pars- ley, the main developing tool is a DSL, implemented with Xtext/Xbase, that provides a rapid customization mechanism. 1 INTRODUCTION Xtext (Itemis, 2014; Eysholdt and Behrens, 2010; Bettini, 2013a), for making the use of our framework The Eclipse Modeling Framework (EMF) (Steinberg easier: customizations can be specified in a compact et al., 2008) simplifies the development of complex form in a single file. software applications with its modeling mechanisms. EMF Parsley is the evolution of EMF Compo- However, the development of user interfaces based on nents (Bettini, 2012; Bettini, 2013b); EMF Compo- EMF still requires an extensive setup and the knowl- nents was a first experiment with building automati- edge of many internal details. For these reasons, in cally applications based on EMF models.
    [Show full text]
  • CICS TS for Z/OS: Using Web Services with CICS Chapter 1
    CICS Transaction Server for z/OS 5.5 Using Web Services with CICS IBM Note Before using this information and the product it supports, read the information in “Notices” on page 635. This edition applies to the IBM® CICS® Transaction Server for z/OS® Version 5 Release 5 (product number 5655-Y04) and to all subsequent releases and modifications until otherwise indicated in new editions. © Copyright International Business Machines Corporation 1974, 2020. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents About this PDF.....................................................................................................vii Chapter 1. CICS and web services..........................................................................1 CICS and SOAP web services ......................................................................................................................3 Message handlers and pipelines............................................................................................................4 SOAP nodes.......................................................................................................................................... 12 SOAP messages and the application data structure........................................................................... 12 WSDL and the application data structure............................................................................................15 WSDL and message exchange patterns...............................................................................................16
    [Show full text]