Object Model

In computing, object model has two related but distinct meanings:

  1. The properties of objects in general in a specific computer programming language, technology, notation or methodology that uses them. For example, the Java objects model, the COM object model, or the object model of OMT. Such object models are usually defined using concepts such as class, generic function, message, inheritance, polymorphism, and encapsulation. There is an extensive literature on formalized object models as a subset of the formal semantics of programming languages.
  2. A collection of objects or classes through which a program can examine and manipulate some specific parts of its world. In other words, the object-oriented interface to some service or system. Such an interface is said to be the object model of the represented service or system. For example, the Document Object Model (DOM) is a collection of objects that represent a page in a web browser, used by script programs to examine and dynamically change the page. There is a Microsoft Excel object model for controlling Microsoft Excel from another program, and the ASCOM Telescope Driver is an object model for controlling an astronomical telescope.

An object model consists of the following important features:

Object Reference: Objects can be accessed via object references. To invoke a method in an object, the object reference and method name are given, together with any arguments.

Interfaces: An interface provides a definition of the signature of a set of methods without specifying their implementation. An object will provide a particular interface if its class contains code that implement the method of that interface. An interface also defines types that can be used to declare the type of variables or parameters and return values of methods.

Actions: Action in an OOP is initiated by an object invoking a method in another object. An invocation can include additional information needed to carry out the method. The receiver executes the appropriate method and then returns control to the invoking object, sometimes supplying a result.

Exceptions: Programs can encounter various errors and unexpected conditions of varying seriousness. During the execution of the method many different problems may be discovered. Exceptions provide a clean way to deal with error conditions without complicating the code. A block of code may be defined to throw an exception whenever particular unexpected conditions or errors arise. This means that control passes to another block of code that catches the exception.

Famous quotes containing the words object and/or model:

    In youth the human body drew me and was the object of my secret and natural dreams. But body after body has taken away from me that sensual phosphorescence which my youth delighted in. Within me is no disturbing interplay now, but only the steady currents of adaptation and of sympathy.
    Haniel Long (1888–1956)

    When Titian was mixing brown madder,
    His model was posed up a ladder.
    Said Titian, “That position
    Calls for coition,”
    So he lept up the ladder and had her.
    Anonymous.