How do you show events in UML Class Diagrams? [closed]
Asked Answered
I

5

15

This one has me stumped regularly while creating top level class diagrams for documentation. Methods and attributes/fields are easy to model. I usually end up adding a method named EvChanged to indicate a .Net event Changed.

What is the right way to show that a type publishes a specific event?

Incombustible answered 9/9, 2008 at 9:33 Comment(0)
H
10

Just add an «event» stereotype to a classifier attribute.

Horacehoracio answered 19/9, 2008 at 4:35 Comment(0)
S
3

I find onEventName() the easiest naming scheme for event callbacks, but how to indicate which events an object can broadcast I've not found any solution. An extended UML class diagram that would allow for customized containers (besides the attribute and method contrainers) could be an alternative, if some tool would support it.

Sorrel answered 15/9, 2008 at 15:40 Comment(0)
A
1

I don't think there is any specific UML notation for showing events that a Class can broadcast. To show events that a Class can receive, you want a Reception element. This has a similar notation to an Operation, with the «signal» keyword.

Antifederalist answered 19/9, 2008 at 4:25 Comment(0)
D
1

I create a stereotype in the model, "PublishedEvent", with a BaseClass of Operation. I apply the stereotype to the Operations in the class.

Decury answered 28/12, 2010 at 22:23 Comment(0)
B
-2

Not the type of answer that I like to give, but Microsoft has an answer on the Office website.

Balbo answered 9/9, 2008 at 13:57 Comment(2)
Visio has some kind of events at the "package" level. A package can contain multiple classes.. each of which can contain multiple events potentially. This link doesn't seem to correspond to a representation of .Net events.Incombustible
Old topic, i know but the Link is deadUlcerous

© 2022 - 2024 — McMap. All rights reserved.