Objects in context: An empirical study of object relationships
Stephanie Balzer, Alexandra Burns, Thomas Groß · 2012
Object collaborations are at the core of all object oriented programming, yet current class-based object oriented programming languages do not provide an ex plicit construct to capture the relationships between ob jects. This paper reports on an empirical study that investigates the occurrence of object collaborations to assess the need of intrinsic support for relationships in a programming language. We introduce a categoriza tion of possible forms of object collaborations and their corresponding implementation patterns when using a traditional class-based object-oriented language (Java) and analyze 25 Java programs (ranging from 4 to 6275 classes) with the Relationship Detector for Java (RelDJ) to identify occurrences of these patterns. The empir ical results show that object collaborations are indeed a frequent phenomenon and reveal that collaboration related code does not remain encapsulated in a single class. These observations strongly support efforts to de fine language constructs to express object relationships: relationships allow the encapsulation of a frequently oc curring phenomenon and increase program expressive ness.