An Approach Based on Metadata to Implement Convention over Configuration
Decoupled from Framework Logic
- Everaldo Gomes,
- Eduardo Guerra,
- Phyllipe Lima,
- Paulo Meirelles
Everaldo Gomes
Universidade de Sao Paulo
Corresponding Author:everaldogjr@gmail.com
Author ProfileAbstract
Frameworks are essential for software development, providing code design
and reuse for its users. Well-known Java frameworks and APIs such as
Spring, JUnit, and JPA rely on metadata usage, commonly defined by code
annotations. Those frameworks use the Java Reflection API for consuming
and processing these annotations. Code elements usually have some
similarities and can also have the same annotation. This paper proposes
a model for defining conventions over configuration for annotations
usage decoupled from the metadata reading logic. With this model, if a
convention is present, the framework will consider that the element is
configured by a specific target annotation, even if the code element
does not have the annotation. We implemented this model in the metadata
reading framework Esfinge Metadata API. The model implementation was
evaluated refactoring an existing framework to add support to
conventions using our approach. As a result, it was possible to
introduce the conventions only by adding configurations to the
annotations. The model was further evaluated in an experiment in which
participants implemented the Conventions over Configuration pattern
using the Esfinge Metadata API and Java Reflection API. Based on the
results, approach fulfilled its goal of supporting the definition of
conventions decupled from the framework logic, making the code more
readable and easier to maintain according to the participants
perception.05 Apr 2023Submitted to Journal of Software: Evolution and Process 05 Apr 2023Submission Checks Completed
05 Apr 2023Assigned to Editor
03 Aug 2023Reviewer(s) Assigned
18 Apr 2024Review(s) Completed, Editorial Evaluation Pending
29 May 2024Editorial Decision: Revise Major
09 Aug 20241st Revision Received
16 Aug 2024Submission Checks Completed
16 Aug 2024Assigned to Editor