Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Role
Last updated at 2:51 pm UTC on 1 November 2018
https://heim.ifi.uio.no/~trygver/1996/book/book11d.pdf

Since objects are meaningless when seen in isolation, we prefer to describe object types in the context of their collaborators.

An object specification model is the role model of a structure of objects that we have implemented or intend to implement.

A role in an object specification model is called an object type, which is a specification of a set of objects with identical externally observable properties.

An implementation of an object type is called a class in conformance with common object-oriented programming terminology.

Different classes can implement the same type.

The inheritance relationships between these classes are implementation issues and immaterial in the context of types.
It may be appropriate to implement two classes in different branches of the class inheritance hierarchy for the same type.

In many cases, we find it convenient to create derived classes for code sharing purposes even if the corresponding objects have dissimilar types.

Objects of the same type can, and often do, play several roles. For example, an object can be member of a list and also the currently selected object.

Therefore, many-to-many relationships exist between objects, roles, types and classes.

Basic OOram concepts


1. The object is the "is" abstraction and represents a part of a system. An object has identity and attributes, and it is encapsulated so that the messages it sends and receives constitute all its externally observable properties.
2. The role is the "why" abstraction. All objects that serve the same
purpose in a structure of collaborating objects as viewed in the context of some area of concern are said to play the same role.
3. The type is the "what" abstraction. All objects that exhibit the same externally observable properties are considered to belong to the same type.
4. The class is the "how" abstraction. All objects that share a common implementation are considered to belong to the same class.