Busca avançada
Ano de início
Entree


An Approach Based on Metadata to Implement Convention Over Configuration Decoupled From Framework Logic

Texto completo
Autor(es):
Gomes, Everaldo ; Guerra, Eduardo ; Lima, Phyllipe ; Meirelles, Paulo
Número total de Autores: 4
Tipo de documento: Artigo Científico
Fonte: JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS; v. 37, n. 5, p. 27-pg., 2025-05-01.
Resumo

Frameworks are essential for software development, providing code design and facilitating reuse for their users. Well-known Java frameworks and APIs rely on metadata configuration through code annotations, using Reflection API to consume and process them. Code elements that share the same annotations often exhibit similarities, creating the opportunity to use conventions as a metadata source. This paper proposes a model for defining Convention over Configuration (CoC) for annotation usage, decoupled from the metadata reading logic. With this model, if a convention is present, the framework will automatically consider that element to be annotated. We implemented this model in the Esfinge Metadata API and evaluated it in an experiment where participants implemented the CoC pattern using two approaches: our proposed one and the Java Reflection API. As a result, 75% of participants implemented our approach faster than with just the Reflection API, and we observed a higher failure rate with the Reflection API than with the Esfinge API. Moreover, the code produced with our approach also resulted in fewer lines of code. Based on these results, we confirmed that the proposed approach fulfilled its goal of supporting the definition of conventions decoupled from the framework logic, thereby improving code readability and maintainability. (AU)

Processo FAPESP: 21/00071-1 - Um estudo sobre o impacto de anotações de código na evolução de software
Beneficiário:Everaldo de Avila Gomes Junior
Modalidade de apoio: Bolsas no Brasil - Programa Capacitação - Treinamento Técnico
Processo FAPESP: 19/12743-4 - Um estudo sobre o impacto de anotações de código na evolução de software
Beneficiário:Paulo Roberto Miranda Meirelles
Modalidade de apoio: Auxílio à Pesquisa - Regular