Question

In my app i have a Document class and a DocumentFact class. The DocumentFact class contains methods which will get multiple Documents from the database. These documents are stored in a datatable or dataset. Both (datatable, dataset) are private members of the documentfact class. They can be accessed via properties.

Now my question is: in a sequence diagram, is it allowed to call a property like this:

Actor      Web interface    DocumentFact          Database
  |          |                 |                      |
  |input     |                 |                      |
  |------->  |  GetDocuments   |                      |
  |          |---------------->|                      |
  |          |                 | ExecuteSelectQuery() |
  |          |                 | -------------------->|
  |          |                 |                      |
  |          |                 |      Bool            |
  |          |                 | <--------------------|
  |          |                 |                      |
  |          |                 |   GetDataSet()       |
  |          |                 | -------------------->|
  |          |                 |                      |
  |          |                 |    DataSet           |
  |          |                 |<---------------------|
  |          |                 |                      |

Where GetDataSet is a property. Is this correct? And if it is not, what is the correct way to do this?

Note: This is just a part of my sequence diagram, the rest is not relevant.

Was it helpful?

Solution

One important thing to remember is that UML is not a formal notation so you can do whatever you think gets the point across. If something is not clear (or you have to think too much about how to represent it) you should probably add a note.

One of the things that I found very helpful in sequence diagrams was to number the messages (or groups of messages) and have a running dialog (formatted as a numbered list) explaining what's going on (... and why you're doing it that way). You have to remember that the diagram does not stand on it's own but should be integrated into a larger body of documentation, thus, how to specifically represent a property isn't really a big deal. Just choose a representation and explain that GetDataSet is a property of Database (or whatever :).

OTHER TIPS

I faced a similar problem while documenting my design. I have just added the text 'property' under the method call (Under the arrow). (I didn't find out the 'right' UML way of doing it.) While that isn't standard UML, as far as I know, that really got the point across. Of course, that might not work out well for you, in which case, you'll be better off with standard UML.

You can show the property with stereotype. For example, if DataSet is the property, and you are calling the getter, use <<get>> stereotype. So it would look like

     DataSet <<get>>
--------------------->

I am not sure if it is in UML spec. But this is as per Scott Ambler's suggestion in his excellent The Elements of UML 2.0 Style.

He also recommends to keep the stereotypes after the name.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top