Structural versus behavioral encapsulation

Object-oriented modeling has clearly been inspired by or, to be more careful, shows significant similarity to the method of semantic modeling that has become popular for developing information systems. In an amusing paper,  [Ki89] discusses how semantic modeling and object-oriented modeling are related. Apart from a difference in terminology, semantic modeling differs from object-oriented modeling primarily by its focus on structural aspects, whereas object-oriented modeling is more concerned with behavioral aspects, as characterized by the notion of responsibilities.

Structural versus behavioral \c{encapsulation}

Semantic modeling {\em -- constructing types}


slide: Semantic modeling

Typically, semantic modeling techniques provide a richer repertoire for constructing types, including a variety of methods for aggregation and a notion of grouping by association. See slide 3-semantic. The object-oriented counterpart of aggregation may be characterized as the has-a or part-of relation, that is usually expressed by including the (part) object as a data member. Associations between objects cannot be expressed directly in an object-oriented framework. On an implementation level, the association relation corresponds to membership of a common collection, or being stored in the same container. However, the absence of an explicit association relation makes it hard to express general m-n relations, as, for example, the relation between students and courses.

Object-oriented modeling

Challenges


slide: Relations between objects

The influence of a semantic modeling background can be clearly felt in the OMT method. The object model of OMT is a rather direct generalization of the entity-relationship model. Entities in the entity-relationship model may only contain (non-object) data members, which are called attributes. In contrast, objects (in the more general sense) usually hide object and non-object data members, and instead provide a method interface. Moreover, object-oriented modeling focuses on behavioral properties, whereas semantic modeling has been more concerned with (non-behavioral) data types and (in the presence of inheritance) data subtypes. Relations, as may be expressed in the entity-relationship model, can partly be expressed directly in terms of the mechanisms supported by object-oriented languages. For instance, the is-a relation corresponds closely (although not completely) with the inheritance relation. See slide 3-challenges. Both the has-a and uses relation is usually implemented by including (a pointer to) an object as a data member. Another important relation is the is-like relation, which may exist between objects that are neither related by the inheritance relation nor by the subtype relation, but yet have a similar interface and hence may be regarded as being of analogous types. The is-like relation may be enforced by parametrized types that require the presence of particular methods, such as a compare operator in the case of a generic list supporting a sort method. Due, partially, to what may be regarded as the natural dynamics of research (which includes financing), there seems to be a trend of convergence between the interests of the object-oriented community and the proponents of semantic modeling. The main challenge, from the perspective of object-oriented programming, is to provide efficient support for persistent objects and (explicit) support for aggregation and association relations. Within the community of database researchers, an interesting debate is going on about whether to extend the relational model with object-oriented notions or whether to start anew from fresh premises. The main challenge, from the perspective of database management systems, is clearly to provide efficient support for the behavioral aspects of objects. One approach is to extend the object model of object-oriented programming languages with persistence as proposed by the Object Database Management Group (ODMG) in  [Cattell94]. See section ODMG. To meet the demands of future applications (featuring graphics and animation), support for persistence should include active objects, having activity of their own, as well. From the perspective of object-oriented modeling, the main issue is to combine both structural and behavioral aspects in a coherent way.