A Metadata Handling API for Framework Development: a Comparative Study

Frameworks play an essential role in software development, providing not only code reuse, but also design reuse. Several Java frameworks and APIs such as Spring, JPA, and CDI rely on the use of metadata, mainly defined by code annotations. These frameworks usually use the Java Reflection API to consume code annotations, which only returns the annotations in a given code element. This strategy, however, is far from the needs of a real framework. The goal of this paper is to propose a novel API, named Esfinge Metadata, to assist in the development of frameworks based on metadata and applications based on custom annotations. Being based on annotations itself, this new API uses them to map metadata to class members. We carried out an experiment to evaluate our API and its impact on aspects such as code structure, complexity, and coupling, while also performing a comparison with the direct use of the Java Reflection API. The participants implemented a metadata-based framework based on realistic requirements in a sequence of 10 tasks that took an average of nine hours. As a result, participants that used our API maintained a more stable code evolution, regarding complexity and coupling as opposed to participants using the Java Reflection API, where the code metrics evolution and structure vary greatly.

[1]  Jerffeson Teixeira de Souza,et al.  Pattern Language for the Internal Structure of Metadata-Based Frameworks , 2013, Trans. Pattern Lang. Program..

[2]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[3]  Uirá Kulesza,et al.  A reference architecture for organizing the internal structure of metadata-based frameworks , 2013, J. Syst. Softw..

[4]  Chenggang Bai,et al.  Characterizing the Usage, Evolution and Impact of Java Annotations in Practice , 2018, IEEE Transactions on Software Engineering.

[5]  Hélio Silva,et al.  A Metrics Suite for code annotation assessment , 2018, J. Syst. Softw..

[6]  Claes Wohlin,et al.  Experimentation in Software Engineering , 2000, The Kluwer International Series in Software Engineering.

[7]  Victor R. Basili,et al.  The TAME Project: Towards Improvement-Oriented Software Environments , 1988, IEEE Trans. Software Eng..

[8]  Margaret M. Burnett,et al.  A practical guide to controlled experiments of software engineering tools with human participants , 2013, Empirical Software Engineering.

[9]  Tommi Mikkonen,et al.  Flow, Intrinsic Motivation, and Developer Experience in Software Engineering , 2016, XP.

[10]  Eduardo Martins Guerra,et al.  Idioms for code annotations in the Java language , 2010, SugarLoafPLoP '10.

[11]  Jing Li,et al.  The Qualitas Corpus: A Curated Collection of Java Code for Empirical Studies , 2010, 2010 Asia Pacific Software Engineering Conference.

[12]  Tore Dybå,et al.  Conducting realistic experiments in software engineering , 2002, Proceedings International Symposium on Empirical Software Engineering.

[13]  Fabian Fagerholm,et al.  Developer experience: Concept and definition , 2012, 2012 International Conference on Software and System Process (ICSSP).

[14]  Gabriele Bavota,et al.  An annotation-based API for supporting runtime code annotation reading , 2017, META@SPLASH.

[15]  Eduardo M. Guerra,et al.  A pattern language for metadata-based frameworks , 2009, PLoP '09.

[16]  Michele Lanza,et al.  Object-Oriented Metrics in Practice - Using Software Metrics to Characterize, Evaluate, and Improve the Design of Object-Oriented Systems , 2006 .

[17]  Junichi Suzuki,et al.  Modeling turnpike frontend system: a model-driven development framework leveraging UML metamodeling and attribute-oriented programming , 2005, MoDELS'05.

[18]  Marco Tulio Valente,et al.  How Annotations are Used in Java: An Empirical Study , 2011, SEKE.