A Metadata Handling API for Framework Development: A Comparative Study

  • Eduardo Guerra Free University of Bozen
  • Phyllipe Lima INATEL
  • Joelma Choma INPE
  • Marco Nardes INPE
  • Tiago Silva USP
  • Michele Lanza University of Lugano
  • Paulo Meirelles USP


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.
Palavras-chave: Framework, Metadata, Annotations, Java, Meta-Framework, Exploratory Experiment, Code Metrics
GUERRA, Eduardo; LIMA, Phyllipe; CHOMA, Joelma; NARDES, Marco; SILVA, Tiago; LANZA, Michele; MEIRELLES, Paulo. A Metadata Handling API for Framework Development: A Comparative Study. In: SIMPÓSIO BRASILEIRO DE ENGENHARIA DE SOFTWARE (SBES), 34. , 2020, Natal. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2020 .