UML sequence diagram call property

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.

Answers


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 :).


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.


Need Your Help

java runtime tracing library to replace system.out.println

java debugging jvm aspectj tracing

Have you heard of any library which would allow me to set up tracing for specific methods at runtime?

how to update events using Ajax

ruby-on-rails jquery

hiii i am new in rails i have a model called events and i have things like todays event ,past events and upcoming events. I am showing the count of my respective event on index page, i want to upda...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.