3C Clear Clean Concise  UML                       Previous   Contents   Next
communityUML 2torial

5.2.1               Object

An object is used when the modeler wished to represent something that she or he regards as existing in the system modeled or in its environment.

An object has the quality of identity: it is itself, and not some other object.An object participates in actions.

An object has a state, which determines the possible future actions of the object.

Some objects are encapsulated: the state of an encapsulated object can be changed only by an action in which the object participates.


Q: How does a UML 2 object differ from a UML 1 object?

A: In UML "An object is an instance that originates from a class." We have not talked about classes yet.  And we might want to ask what 'to originate' means in this particular context.  Instead, let's get on with answering the question as best we can. 

To do that, let's take the quoted sentence from the UML 1.4 specification to mean: An object is a model element that is created using a class as a specification.   Then, the answer is that, unlike UML 1, the user of UML 2 may declare objects without classes.  

The UML 1 notation certainly allows this.  But the metamodel drawings and the well-formedness rules of Instance seem to require there to be at least one class for every object. It might, of course, be said that the class is implicit, or is hidden by abstraction.

But here is a question as part of this answer: Which comes first, objects or classes?  In UML 2, objects come first.  You may declare objects in your model.  You may declare classes.  You may declare objects that are created using those classes.  You may even adopt the design rule that every object is created using a class.  That will be your design rule, not a rule imposed by UML 2.


 

Previous   Contents   Next         RunningExample

  DA.gif (4367 bytes)

The OMG mark, ‘UML,’  is a trademark of Object Management Group, Inc. (OMG). 


During development of this web site, please send comments to Joaquin Miller. mailto:joaquin@acm.org    
Copyright © 2000 Financial Systems Architects