Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to represent class instances in UML?

I have a class diagram for my application which consists of several compositions and aggregations.

Now I want to have diagram based on the class diagram which shows class instances. A snapshot if you will. I need this because it would help discussing some functional requirements.

Class diagram:

 --------   1                 *  ------- 
| Parent |----------------------| Child |
 --------                        -------

"Instance" diagram:

 --------                        --------- 
| Parent |----------------------| Child 1 |
 --------           |            ---------
                    |
                    |            ---------
                    +-----------| Child 2 |
                    |            ---------
                    |
                    |            ---------
                    +-----------| Child 3 |
                                 ---------

Is there a diagram type for this? (Currently I'm mis-using a class diagram, where all my instances are separate classes)

like image 711
Daniel Rikowski Avatar asked Nov 17 '10 09:11

Daniel Rikowski


2 Answers

  • Use Object diagram or
  • Use keyword <<instance>> or
  • Underline class name
like image 142
bancer Avatar answered Oct 05 '22 10:10

bancer


An "instance" diagram in UML is called an Object Diagram.

like image 30
Peter G. McDonald Avatar answered Oct 05 '22 10:10

Peter G. McDonald