|
Object Modeling
Object modeling describes systems as built out of objects: programming abstractions that have identity, behavior, and state. Objects are an abstraction beyond abstract data types (ADTs), where data and variables are merged into a single unifying concept. As such they object modeling includes many other concepts: abstraction, similarity, encapsulation, inheritance, modularity, and so on. See references for Object-Oriented design ([Booch 95], [Rumbaug+BPEL 91], [Kilov+R 94]) for more information on the concepts of object modeling.
For this paper, we will be concerned with the basic object concepts of identity, behavior, state, and encapsulation. We will also need some higher level concepts of type, association, class, and inheritance. Each of these will be defined below.
Basic Concepts
Identity
Objects have identity, which distinguishes them from all other objects. This is the crucial step for describing how objects are different from ADTs. When an object is created it is distinguishable from all other objects whether its state (or "value") happens to be equal
State
Because an object can be distinguished independently of its "value", it has a state: the current value associated with this identity. Objects can have a single state through their whole life (which would make them degenerately like ADTs) or can go through many state transitions. Because objects are encapsulated, the state is an abstraction and is only visible by examining the behavior of the object.
Behavior
Objects provide an abstraction that clients can interact with. The behavior of an object is the collection of provided interactions (called methods or operations and, collectively, an interface) and the response to these method calls (or "messages"). All interactions with an object must be through its interface and all knowledge about an object is from its behavior (returned values or side effects) to the interface interaction.
Encapsulation
Encapsulation provides an abstraction and prevents external parties from seeing the implementation details for that abstraction. For objects, clients can interact with the public behavior of the object (and by so doing identify the state of an object) but they can not see how the behavior and the state are implemented.
Higher-level Concepts
Type
A type is the specification of an interface that objects will support. An object implements a (is a) type if it provides the interface described by the type. All object of the same type can be interacted with through the same interface. An object can implement multiple types at the same time.
Associations
Types can be associated with other types, which specifies that the objects of one type can be linked to objects of the other type. Having a link provides the ability to traverse from one object to the other objects involved in the link.
Class
One approach for implementing objects is to have a class, which defines the implementation for multiple objects. A class defines what types the objects will implement, how to perform the behavior required for the interface and how to remember state information. Each object will then only need to remember its individual state. Although using classes is by far the most common object approach, it is not the only approach (using prototypes is another approach) and is really peripheral to the core concepts of object-oriented modeling.
Inheritance
Inheritance can apply to types or to classes. When applied to types, inheritance specifies that object of Type B that inherits from Type A can be used just like an object of Type A. Type B is said to conform to Type A and all objects that are Type Bs are also Type As.
When applied to Classes, inheritance specifies that a class uses the implementation of another class with possible overriding modification. This frequently implies type inheritance also but that is not always the case.
Summary
Object models are different from other modeling techniques because they have merged the concept of variables and abstract data types into an abstract variable type: an object. Objects have identity, state, and behavior and object models are built out of systems of these objects. To make object modeling easier, there are concepts of type, inheritance, association, and possibly class. Although object modeling is only a small step from data type oriented programming, it produces a significantly different feel and structure for programs. Object modelings focus on identity and behavior is completely different from the relational models focus on information.
|