80 likes | 205 Vues
This paper explores the identification of design patterns and antipatterns in software development using Prolog. We focus on the Observer pattern, detailing the relationships and components involved, such as Project, Subject, and various observers and subjects. Additionally, we examine the God Class antipattern, where a single class assumes excessive responsibilities, leading to poor design and maintainability. Through a series of results, we aim to provide insights into effective pattern detection and the implications of antipatterns on software quality.
E N D
Alecsandar STOIANOV Detecting patterns and antipatterns in software using prolog
Introduction Legacy software
Observer • observerPattern(Project, SubjectN, ObserverN, ConcrSubjsN,ConcrObserversN, UpdateMsN,AttDetMeths,NotifyMeth):- observer(Observer,ObserverN,Project), subject(Subject,SubjectN,Observer,AttDetMeths,NotifyMeth,UpdateMsN), findall(X,concreteSubject(_,X,Subject),ConcrSubjsN), findall(Y,concreteObserver(_,Y,Observer),ConcrObserversN).
God Class • This AntiPattern is characterized by a class diagram composed of a single complex controller class surrounded by simple data classes. The key problem here is that the majority of the responsibilities are allocated to a single class.
Questions & Answers?