Generating the Interface Hierarchy of a Class Library

GENERATINGTHE INTERFACEHIERARCHYOF A CLASS LIBRARYAMINA ARFI1, ROBERT GODIN, HAFEDH MILI,GUY MINEAU2, ROKIA MISSAOUI11 - Departement d'Informatique2 - DUniversite du Quebec a MontrealFaculte des Sciences et de GenieC.P. 8888, Succursale Centre Vil leUniversite LavalMontreal, QuebecQuc, QuCanada, H3C 3P8Canada, G1K 7P4ABSTRACTA to ol for generating the interface hierarchy of a set of classes for the Smalltalk-80library is describ ed.The to ol can b e useful for analyzing the class library or simplyforreusepurp osesbyprovidinganalternativeviewthatisclosertotheclient'sp ersp ectivethan the inheritance hierarchy.The interface of each class to consideris extracteddirectlyfrom theSmalltalk co de.From theextractedinterfaces,theinterfacehierarchycanb egeneratedautomatically basedonstructuresfrom thetheoryof concept(Galois) lattices.Asimple graphical userinterfaceis providedfor browsing the resulting hierarchy.1.Intro ductionGeneratingtheinterfacehierarchyofasetclassesisanimp ortantto olforunderstanding and analyzing a class library.Co ok5generated the interface hierarchyoftheSmalltalk-80Col lectionclassesanduseditasato oltoreviewdesignofthelibrary.Thishelp edtoidentifyseveralproblemswithandsuggestimprovements.Hisanalysisalsoshowedseveraldiscrepanciesb eteentheinheritancehierarchyandtheinterface.Theisbasedontheinclusionofmessageselectorssetsandreectsconformanceorsubtyp erelationshipb etweenclasses.Itrepresentstheclienviewoflibrary.Onotherhand,theinheritancehierarchyshowsimplementersviewoflibrary.Forexample,inheritanceissometimesusedonlyforco dereusepurp oseswhichasobserved by Cox6pro duces libraries that are more dicult to understand and reuse.Delegation could b e used in such circumstances for reuse purp oseswhile keeping thehierarchy cleaner from a conceptual p oint of view.Other authors have also addressedthis p oint explicitly4;1215.KorsonandMcGregor13lo oked atthe evaluationofthe quality of classlibrariesfromageneralp ointofviewandprop osedsomesp eci ccriteriatoconsider.Twocriteria among those prop osed concern the design of the class hierarchy.They also ad-vo cate that inheritance should b e used to implement the generalization/sp ecialization(subtyp e) relationship.From the user p oint of view, this kind of architecture is moreintuitive and easy to use.The correctness of p olymorphic substitution of an instance