MSPLS Spring '95 Workshop

Object Interactions as First Class Objects: From Design to Implementation

Mahesh Dodani, Kok Siew Gan, and Lizette Velazquez
Department of Computer Science, The University of Iowa

Collaborations between objects make up the dynamic behavior of OO software. These collaborations among objects require careful design and implementation. Treating the interactions as added responsibilities, that are integrated in the participating objects, results in tight coupling between objects. Tight coupling increases complexity and reduces reusability. Object interactions need to be first class objects from design to implementation. Our research provides a unified approach to model and implement these interactions as first class objects. During analysis and design, they are modeled using DynaSpecs. During implementation, they are coded with a new language construct called Compositions. Both constructs provide a consistent support for object interactions within each phase of the OO lifecycle.

Current OO methodologies model the static structure and dynamic behavioral aspects of OO systems. Static models use entity relationship diagrams to describe attributes in objects and their structural relationships. The dynamic model aim to describe the complex interactions between objects at run time. Interactions among collaborating objects are typically identified in the analysis phase through scenarios (use cases) that expose the functionality of the system. Most methods use object interaction diagrams to model interactions during the design phase. These diagrams capture the objects involved in the interaction and the corresponding flow of message passing. The interactions among objects encompass the assumptions that each makes about other. To understand objects interactions we need to know not just the associated message flow and the participating objects, but also what the state changes and interaction behavior of each the participating objects.

In current methodologies all this information is distributed over the entire spectrum of models: object models, operational models, interaction graphs and state machines. Furthermore, in the design of object classes, the behavior of interactions is scattered across the collaborating classes. This distribution of information and behavior across models increases the redundancy of information, complexity of the classes, and the coupling among classes. This result in difficulties to establishing invariants and properties of the system, difficulty in ensuring proper access to methods, and difficulty in ensuring consistent update of participating objects to reflect dynamic changes. Our model, DynaSpec supports the specification of objects and interactions as first class objects. DynaSpecs model the object interactions using state transitions. The state transitions represent events of message calls that mirror the dynamic behavior of object interactions. The formal semantics of the model is based on the idea of a history which captures the sequence of operations within interactions along with state changes undergone by the participating objects.

Current OO programming language allow programmers to implement object interactions as first class objects by using classes with variable references to participating objects. However, this implementation have the following disadvantages:

We provide a new construct called Composition to implement object interactions. Compositions, as well as DynaSpecs allow programmers and systems designers to The semantics for DynaSpecs and Compositions have been precisely defined using denotational semantics. They have been tested with prototype executable of the constructs written in ML. These constructs can be added to any existing Object-Oriented System known to us, making the constructs attractive to any OO Design and Development System. In this paper, we will explain the problems with the current approaches in modeling and implementing interactions using the MVC framework as an example. We have modeled the MVC framework using DynaSpecs and implemented the new MVC design using our prototype language. The paper will present our results.
Gerald Baumgartner