简体   繁体   English

如何在 Uml 用例图中显示工具栏

[英]How do I present in a Uml use-case Diagram a toolbar

I am new to object oriented design and I wanted to do my first ever UML use case Diagram on a simple application which contains toolbar on the top left corner.我是面向对象设计的新手,我想在一个简单的应用程序上做我的第一个 UML 用例图,该应用程序在左上角包含工具栏。 The toolbar is called files and when the user clicks on it,a drop down menu is opened with options to open a slide,save slide,make new slide and exit the application.工具栏称为文件,当用户单击它时,会打开一个下拉菜单,其中包含打开幻灯片、保存幻灯片、制作新幻灯片和退出应用程序的选项。
My question is, am I doing it correct with Use-Case inheritance(Generalization) ?我的问题是,我在用例继承(泛化)方面做得对吗?
This is my diagram.这是我的图表。在此处输入图片说明

I am sorry to disapoint you, but I have to tell you that this practice is just plain wrong:很抱歉让您失望,但我必须告诉您,这种做法完全错误:

  • From the point of view of the semantics , the use-case specialization means that Open presentation is a special form of Check file , and Save file as well, and that the actor could use them interchangeably and independently.语义的角度来看, 用例特化意味着Open presentationCheck fileSave file一种特殊形式,并且参与者可以互换和独立地使用它们。 But this cannot be what you mean: exiting a presentation is at best a sub-part of checking a file但这不可能是您的意思:退出演示文稿充其量只是检查文件的一个子部分

  • From the point of view of the purpose , a use-case should represent a user goal.目的的角度来看,用例应该代表用户目标。 It's part of the problem space, ie what the user wants to achieve.它是问题空间的一部分,即用户想要实现的目标。 It's not part of the solution space, ie how the user will achieve it.它不是解决方案空间的一部分,即用户将如何实现它。 A toolbar is not a goal: it's a user-interface element.工具栏不是目标:它是一个用户界面元素。

  • From the engineering practice perspective, use-case should not be used for user-interface design.工程实践的角度来看,用例不应该用于用户界面设计。 It's not my own statement, but that of Jacobson, Booch and Rumbaugh, the founding fathers of UML:这不是我自己的声明,而是 UML 的创始人 Jacobson、Booch 和 Rumbaugh 的声明:

    The problem is that the [use-case] descriptions often contain implicit decisions about user-interfaces.问题在于 [用例] 描述通常包含有关用户界面的隐式决定。 Later, when the user interface designers suggest suitable user-interfaces for the use-case , they may be limited by those decisions.后来,当用户界面设计者为用例建议合适的用户界面时,他们可能会受到这些决定的限制。
    in The unified software development process , page 164统一软件开发过程中,第 164 页

So in conclusion, it's a bad idea to start use-cases from the user-interface.所以总而言之,从用户界面开始用例是一个坏主意。 It locks you into your own design and ignores the user experience.它会将您锁定在自己的设计中,而忽略了用户体验。 You should focus instead only on the user needs.您应该只关注用户需求。 THe same use-case could then be used whether you'll implement it using a GUI interface, a chatbot interface, or aa voice-based interface.无论您是使用 GUI 界面、聊天机器人界面还是基于语音的界面来实现它,都可以使用相同的用例。

While drawing Use Case diagram, one thing you should focus on is, the actual meaning of it and the purpose of drawing it.在绘制用例图时,您应该关注的一件事是它的实际含义以及绘制它的目的。

A Use Case refers to what the users in respect of their type are able to do in your System... Anything inside the boundary is what system is capable of doing or what it can provide as a service to its users.用例是指用户在您的系统中能够做什么……边界内的任何东西都是系统能够做什么或它可以作为服务提供给用户的内容。

While naming the use cases, you should only use verbs and actions, for example:在命名用例时,您应该只使用动词和动作,例如:

1- Login | 1- 登录 | 2- Submit a Request | 2- 提交请求 | 3- Update Profile Description 3- 更新配置文件说明

You should avoid any nouns in them.你应该避免使用它们中的任何名词。

There are several relationships that exist in a Use Case Diagram among use cases, and a relationship among actors and use cases of the system, And They are as follows:在用例图中,用例之间存在几种关系,系统的参与者和用例之间存在关系,它们如下:

Association: the only relationship that can exist between an actor and a use case;关联:参与者和用例之间可以存在的唯一关系; Which says the actor is initiator of this use case, or is the one who is caple of operating the use case.这表示参与者是这个用例的发起者,或者是负责操作用例的人。

在此处输入图片说明

In the example above, User is caple of loggin in and submitting a complaint.在上面的示例中,用户可以登录并提交投诉。

Include: Use Cases can include one or more use cases.包括:用例可以包括一个或多个用例。 When a use case includes another use case, it means the included use case or use cases happen all the time and are part of the initial use case.当一个用例包含另一个用例时,这意味着包含的一个或多个用例一直发生并且是初始用例的一部分。

在此处输入图片说明

Paying fees is included, because user has to pay the fees in signing up process, it has to be done, and it's part of the baseline path of the scenario.付费是包括在内的,因为用户在注册过程中必须付费,这是必须完成的,它是场景的基线路径的一部分。

Extend: When a use case is not happening all the time, and is part of your alternative path ( Alternative path of the complete scnario for this use case ), the use case should be extended to the base use case.扩展:当用例不是一直发生时,并且是替代路径的一部分(此用例的完整场景的替代路径),用例应该扩展到基本用例。

在此处输入图片说明

Forget password is extended to Login use case, because it doesn't happen all the time, and it's part of a alternative path of Login scenario.忘记密码扩展到登录用例,因为它不会一直发生,并且它是登录场景的替代路径的一部分。

Generalization: When there exist several different ways that a use case can be performed and completed, we use generalization.泛化:当有几种不同的方式可以执行和完成用例时,我们使用泛化。 The inheritent use cases should all be of the same type as the inherited use case.继承用例都应该与继承用例属于同一类型。

在此处输入图片说明

Submitting a complaint can be done in several different ways, in this case, we need to seprate each use case and inherit from from the submit a complaint use case which includes paying fees, this shows that, paying fees is a part of every type of complaint which is submitted.提交投诉可以通过几种不同的方式完成,在这种情况下,我们需要分离每个用例并从提交投诉用例继承,其中包括支付费用,这表明支付费用是每种类型的一部分提交的投诉。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM