Title :
Are the Methods in Your Data Access Objects (DAOs) in the Right Place? A Preliminary Study
Author :
Aniche, Mauricio F. ; Oliva, Gustavo A. ; Gerosa, Marco A.
Author_Institution :
Dept. of Comput. Sci., Univ. of Sao Paulo, Sao Paulo, Brazil
Abstract :
Isolating code that deals with system infrastructure from code that deals with domain rules is a good practice when developing applications. Code that deals with the database, for example, is often isolated in classes following a Data Access Object (DAO) pattern. Developers often create a DAO for each domain entity in the system. However, as some pieces of code deal with more than one entity/table, developers need to decide in which DAO they will place the code, and sometimes choose a less intuitive location. In this paper, we present a heuristic to identify methods that may have been written in an ambiguous place. To validate the idea, we tested it on three industrial projects from a Brazilian company. The heuristic selected, on average, 13% to 18% of the methods in DAOs. After evaluating such methods, we concluded that the heuristic was correct in 50% to 75% of cases. Therefore, we believe that the heuristic can indicate possible technical debt, where the developers may inspect and possibly refactor.
Keywords :
object-oriented methods; DAO pattern; code isolation; data access objects; object-oriented software development; Algorithm design and analysis; Companies; Databases; Java; Maintenance engineering; Measurement; Software; data access objects; mining software repositories;
Conference_Titel :
Managing Technical Debt (MTD), 2014 Sixth International Workshop on
Conference_Location :
Victoria, BC
DOI :
10.1109/MTD.2014.14