Skip to main content

Metamodeling vs Metaprogramming: A Case Study on Developing Client Libraries for REST APIs

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 9764))

Abstract

Web-services with REST APIs comprise the majority of the programmable web. To access these APIs more safely and conveniently, language specific client libraries can hide REST details behind regular programming language idioms. Manually building such libraries is straightforward, but tedious and error prone. Fortunately, model-based development provides different methods to automate their development. In this paper, we present our experiences with two opposing approaches to describe existing REST APIs and to generate type-safe client side Java libraries from these descriptions. First, we use an EMF-metamodel and a code generator (external DSL). Secondly, we use the Java compatible language Xtend and its metaprogramming mechanism active annotations, which allows us to alter the semantics of existing Xtend constructs to describe REST APIs within Xtend (internal DSL). Furthermore, we present related approaches and discuss our findings comparatively.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

References

  1. F# data: Json type provider. http://fsharp.github.io/FSharp.Data/library/JsonProvider.html

  2. Betten, S.: Richardson maturity model. Technical report, Fachgebiet Software Engineering, Universität Hannover (2011)

    Google Scholar 

  3. Cánovas Izquierdo, J.L., Cabot, J.: Discovering implicit schemas in JSON data. In: Daniel, F., Dolog, P., Li, Q. (eds.) ICWE 2013. LNCS, vol. 7977, pp. 68–83. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  4. Eclipse.org: Xtend. http://www.eclipse.org/xtend/

  5. Ed-Douibi, H., Izquierdo, J.L.C., Gómez, A., Tisi, M., Cabot, J.: EMF-REST: generation of restful apis from models. CoRR (2015)

    Google Scholar 

  6. Efftinge, S.: Jsonized. http://github.com/svenefftinge/jsonized

  7. FasterXML: Jackson json processor wiki. http://wiki.fasterxml.com/JacksonHome

  8. Fielding, R.T.: Architectural Styles and the Design of Network-based Software Architectures. Ph.D. thesis (2000)

    Google Scholar 

  9. Fowler, M.: Domain Specific Languages, 1st edn. Addison-Wesley Professional, Boston (2010)

    Google Scholar 

  10. Gerhart, M., Bayer, J., Höfner, J.M., Boger, M.: Approach to define highly scalable metamodels based on JSON. In: BigMDE 2015, p. 11 (2015)

    Google Scholar 

  11. Izquierdo, J.L.C., Cabot, J.: Composing JSON-based web APIs. In: Casteleyn, S., Rossi, G., Winckler, M. (eds.) ICWE 2014. LNCS, vol. 8541, pp. 390–399. Springer, Heidelberg (2014)

    Google Scholar 

  12. Maximilien, E.M., Wilkinson, H., Desai, N., Tai, S.: A domain-specific language for web APIs and services mashups. In: Krämer, B.J., Lin, K.-J., Narasimhan, P. (eds.) ICSOC 2007. LNCS, vol. 4749, pp. 13–26. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  13. Menkudle, A., Sonawane, S., Jagtap, A.: Extracting application model from restful web services for client stub generation. Int. J. Comput. Technol. Appl. (IJCTA) 5(1), 226–232 (2014)

    Google Scholar 

  14. Rivero, J.M., Heil, S., Grigera, J., Gaedke, M., Rossi, G.: MockAPI: an agile approach supporting API-first web application development. In: Daniel, F., Dolog, P., Li, Q. (eds.) ICWE 2013. LNCS, vol. 7977, pp. 7–21. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  15. Scheidgen, M.: XRAW-Easy development of REST API client libraries with Xtend. http://github.com/markus1978/xraw

  16. Sheard, T.: Accomplishments and research challenges in meta-programming. In: Taha, W. (ed.) SAIG 2001. LNCS, vol. 2196, pp. 2–44. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  17. Tavares, N., Vale, S., Luis, S., Brazil, M.: Towards interoperability to the implementation of RESTful web services: a model driven approach. In: International Conference on Systems (ICONS), pp. 234–240 (2014)

    Google Scholar 

  18. Tilkov, S.: REST und HTTP: Einsatz der Architektur des Web für Integrationsszenarien. dpunkt, Heidelberg (2009)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Markus Scheidgen .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Scheidgen, M., Efftinge, S., Marticke, F. (2016). Metamodeling vs Metaprogramming: A Case Study on Developing Client Libraries for REST APIs. In: Wąsowski, A., Lönn, H. (eds) Modelling Foundations and Applications. ECMFA 2016. Lecture Notes in Computer Science(), vol 9764. Springer, Cham. https://doi.org/10.1007/978-3-319-42061-5_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-42061-5_13

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-42060-8

  • Online ISBN: 978-3-319-42061-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics