摘要
分层Web应用的领域层由领域模型构成.仅存储数据且不实现行为的领域模型被称作失血领域模型,其状态和数据由非领域层中的类维护,造成后者的充血现象.失血和充血现象损害了Web应用的可维护性,然而,由于缺乏量化分析和研究,其论据多基于主观经验得出.本文度量三种Code Smell(Feature Envy、Blob和Data Class)的强度,将它们作为衡量失血和充血现象的标准,对现象进行量化分析,进而得出它们之间的相关性.本文对一个公开数据集的91个Java Web项目及10个不同领域的开源Java Web应用的多个版本进行了实验,实验发现至少有75%的项目受领域层失血和服务层充血现象的影响,这些现象极少被解决或减弱,两者的强度在不同类间存在相关性,且两者强度的增量在同一软件项目的不同版本间亦存在相关性.
Domain Models shape the Domain Layer of Web Applications.Anemic Domain Models(ADMs)are Domain Models holding only data.States of ADMs are maintained by classes in other layers,causing the latter bloodshot.However,there lacks research revealing the significance of impact that anemia and bloodshot of layers pose on maintainability.To quantify the significance,this paper assesses intensity of 3 Code Smells(Feature Envy,Blob and Data Class)as evaluation standards.Through an experiment conducted on 91 Java projects and multiple releases of 10 Java Web applications,this paper concludes that over 75%of the projects are affected.As the impact persists,correlations of the intensities exist among different classes of a project as well as same classes in different releases of a project.
作者
黄子杰
陈军华
高建华
HUANG Zi-jie;CHEN Jun-hua;GAO Jian-hua(Department of Computer Science and Technology,Shanghai Normal University,Shanghai 200234,China)
出处
《电子学报》
EI
CAS
CSCD
北大核心
2020年第4期772-780,共9页
Acta Electronica Sinica
基金
国家自然科学基金(No.61672355)。