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.