HOME

TheInfoList



OR:

In
object-oriented programming Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of pr ...
, an object diagram in the
Unified Modeling Language The Unified Modeling Language (UML) is a general-purpose, developmental modeling language in the field of software engineering that is intended to provide a standard way to visualize the design of a system. The creation of UML was originally m ...
(UML) is a
diagram A diagram is a symbolic representation of information using visualization techniques. Diagrams have been used since prehistoric times on walls of caves, but became more prevalent during the Enlightenment. Sometimes, the technique uses a three- ...
that shows a complete or partial view of the structure of a modeled
system A system is a group of Interaction, interacting or interrelated elements that act according to a set of rules to form a unified whole. A system, surrounded and influenced by its environment (systems), environment, is described by its boundaries, ...
at a specific time.


Overview

In the
Unified Modeling Language The Unified Modeling Language (UML) is a general-purpose, developmental modeling language in the field of software engineering that is intended to provide a standard way to visualize the design of a system. The creation of UML was originally m ...
(UML), an object diagram focuses on some particular set of
objects Object may refer to: General meanings * Object (philosophy), a thing, being, or concept ** Object (abstract), an object which does not exist at any particular time or place ** Physical object, an identifiable collection of matter * Goal, an ...
and
attributes Attribute may refer to: * Attribute (philosophy), an extrinsic property of an object * Attribute (research), a characteristic of an object * Grammatical modifier, in natural languages * Attribute (computing), a specification that defines a proper ...
, and the links between these instances. A correlated set of object diagrams provides insight into how an arbitrary view of a system is expected to evolve over time. Early UML specifications described object diagrams as such:
"An object diagram is a graph of instances, including objects and data values. A static object diagram is an instance of a class diagram; it shows a snapshot of the detailed state of a system at a point in time. The use of object diagrams is fairly limited, namely to show examples of data structure."
The latest UML 2.5 specification does not explicitly define object diagrams, but provides a notation for instances of classifiers. Object diagrams and class diagrams are closely related and use almost identical notation. Both diagrams are meant to visualize static structure of a system. While class diagrams show classes, object diagrams display instances of classes (
objects Object may refer to: General meanings * Object (philosophy), a thing, being, or concept ** Object (abstract), an object which does not exist at any particular time or place ** Physical object, an identifiable collection of matter * Goal, an ...
).Bianca Scholten (2007) ''The Road to Integration: A Guide to Applying the ISA-95 Standard in Manufacturing''. p.155 Object diagrams are more concrete than
class diagram In software engineering, a class diagram in the Unified Modeling Language (UML) is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, operations (or methods), and the rela ...
s. They are often used to provide examples or act as test cases for class diagrams. Only aspects of current interest in a model are typically shown on an object diagram.


Object diagram topics


Instance specifications

Each object and link on an object diagram is represented by an ''InstanceSpecification''. This can show an object's classifier (e.g. an abstract or concrete
class Class or The Class may refer to: Common uses not otherwise categorized * Class (biology), a taxonomic rank * Class (knowledge representation), a collection of individuals or objects * Class (philosophy), an analytical concept used differentl ...
) and instance name, as well as attributes and other structural features using ''slots''. Each ''slot'' corresponds to a single attribute or feature, and may include a value for that entity. The name on an instance specification optionally shows an instance name, a ':' separator, and optionally one or more classifier names separated by commas. The contents of slots, if any, are included below the names, in a separate attribute compartment. A link is shown as a solid line, and represents an instance of an
association Association may refer to: *Club (organization), an association of two or more people united by a common interest or goal *Trade association, an organization founded and funded by businesses that operate in a specific industry *Voluntary associatio ...
.


Object diagram example

Consider one possible way of modeling production of the
Fibonacci sequence In mathematics, the Fibonacci numbers, commonly denoted , form a integer sequence, sequence, the Fibonacci sequence, in which each number is the sum of the two preceding ones. The sequence commonly starts from 0 and 1, although some authors start ...
. In the first UML object diagram on the right, the instance in the leftmost instance specification is named ''v1'', has ''IndependentVariable'' as its classifier, plays the ''NMinus2'' role within the ''FibonacciSystem'', and has a slot for the ''val'' attribute with a value of ''0''. The second object is named ''v2'', is of class ''IndependentVariable'', plays the ''NMinus1'' role, and has ''val = 1''. The ''DependentVariable'' object is named ''v3'', and plays the ''N'' role. The topmost instance, an anonymous instance specification, has ''FibonacciFunction'' as its classifier, and may have an instance name, a role, and slots, but these are not shown here. The diagram also includes three named links, shown as lines. Links are instances of an association. In the second diagram, at a slightly later point in time, the ''IndependentVariable'' and ''DependentVariable'' objects are the same, but the slots for the ''val'' attribute have different values. The role names are not shown here. In the last object diagram, a still later snapshot, the same three objects are involved. Their slots have different values. The instance and role names are not shown here.


Usage

If you are using a UML modeling tool, you will typically draw object diagrams using some other diagram type, such as on a
class diagram In software engineering, a class diagram in the Unified Modeling Language (UML) is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, operations (or methods), and the rela ...
. An object instance may be called an ''instance specification'' or just an ''instance''. A link between instances is generally referred to as a ''link''. Other UML entities, such as an aggregation or
composition Composition or Compositions may refer to: Arts and literature *Composition (dance), practice and teaching of choreography *Composition (language), in literature and rhetoric, producing a work in spoken tradition and written discourse, to include v ...
symbol (a diamond) may also appear on an object diagram.


References


External links


General information on UML
including the official UML 2.0 specification. See especially the section on InstanceSpecification.
The Expressive Power of Object Diagrams
an illustration from the real world
Modal object diagrams
an extension of object diagrams with existential/universal and positive/negative modes. {{DEFAULTSORT:Object Diagram Unified Modeling Language diagrams