可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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?
回答1:
回答2:
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.
回答3:
回答4:
I create a stereotype in the model, "PublishedEvent", with a BaseClass of Operation. I apply the stereotype to the Operations in the class.
回答5:
Not the type of answer that I like to give, but Microsoft has an answer on the Office website.