如何代表“事件”?在UML类图中? [英] How to represent "event" in a UML Class Diagram?

查看:332
本文介绍了如何代表“事件”?在UML类图中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码段

public class Notation : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;

    private Notes _note;
}

如何写作 公共事件PropertyChangedEventHandler PropertyChanged; 在UML类图中是否正确?

How to write public event PropertyChangedEventHandler PropertyChanged; in UML Class diagram properly?

首先,我认为是:


+ PropertyChanged:PropertyChangedEventHandler

+PropertyChanged: PropertyChangedEventHandler

但是后来我意识到并不代表代码的事件部分。

But then, I realized that it doesn't represent the event part of the code.

有什么想法吗?谢谢

推荐答案

这是游戏中的UML原型。只需对此属性进行原型化即可:

Here is the UML stereotype in the game. Just stereotype this property:

请注意, _note 是普通的私有财产。

Note that _note is a plain, private property.

这篇关于如何代表“事件”?在UML类图中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆