如何在用例图中表示子模块

发布于 2025-01-06 09:21:11 字数 262 浏览 5 评论 0原文

我需要知道如何表示模块的子模块。

例如,我有一个名为 X 的模块。该模块 X 实际上由名为 x1、x2 和 x3 的三个子模块组成。用户可以从可用选项中选择该子模块中的任何一个。这意味着如果没有这 3 个子模块,该模块就不会退出。我的疑问是,在绘制用例图时,我如何表示这个子模块?我必须对主模块中的该子模块使用“包含”或“扩展”吗?

另一个疑问是,当我绘制x1的用例图时。我如何表示一个名为“查看位置”的主要工作和一个名为“更改地图视图”的可选工作

请解释答案。

I need to know, how to represent the sub modules of a module.

For example i am having a module called X. This module X is actually made up of three sub modules called x1, x2 and x3. User can choose any of this sub module from the available options. That means this module does not exits with out this 3 sub modules. My doubt is that while drawing the use case diagram how can i represent this sub modules? I have to use "include" or "extend" for this sub modules from the main module?

Another doubt is that when i am drawing the use case diagram of x1. How can I represent a main work called "view location" and an optional work called "change map view"

Kindly explain the answer.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奢欲 2025-01-13 09:21:11

第一的

用例只是描述“用户可以使用您的系统做什么”。

这个简单的定义有时会让很多人感到困惑:

当我们询问用户可以用您的系统做什么时,他们告诉
早期原型 GUI 上的选项菜单。

在你的问题中,我认为你也谈论了“GUI”。据我了解你有一个 GUI 原型,
其中用户选择“X Module”选项,然后向用户显示“X1,X1,X3”子选项操作...

用例对您的 GUI 详细信息“不感兴趣”。它试图捕捉真正的“动机”……

为了说清楚:假设您正在为银行设计经典的 ATM 机。

用户想用 ATM 做什么?假设他想通过 ATM 支付账单...

简单用例图为此:

在此处输入图像描述

但是如何他会支付他/她的账单吗?这是通过用例描述捕获的[不是图表,用例文本]...
假设我们的客户说用户可以支付这些账单:他/她的手机账单,他/她的电费账单,可能是他/她的税费。您会发现每种支付都有不同的特征。

中编写用例描述

然后您开始在[系统执行此操作,参与者执行此操作]表单用例:支付账单
...................

主要场景:

  1. 系统显示 ATM 操作
  2. 用户选择 PayBill 选项
  3. 系统显示那些 Pay Bill 操作

    A) 支付手机话费

    B)支付电费

    C)...

  4. 用户选择一个选项

  5. 如果用户选择支付手机账单,则

    5.a) 系统询问手机号码..

    ......
    ......

    5.n) 系统询问用户是否需要收据

    5.n+1) 用户想要收据

    5.n+2) 系统给出收据
    ......

    .....

  6. 如果用户选择支付电费则
    ……
    ...

  7. 如果用户选择 X 选项,则
    ....
    ....

作为一般规则,不要用大量的内容弄脏你的用例图
“扩展”或“包含”、“概括”

因此,结果是:我们无法知道“更改地图视图”或“查看位置”是否是一个真实的用例[我们应该在图表中显示]或者只是一个步骤用例场景。这些取决于您的背景...

作为实用建议,您可以应用 Craig Larman 3 测试来确定这些是否是真实的用例:

  • 老板测试:像“老板”一样思考。并告诉演员[将演员视为你的员工]“改变看法”。这让身为“Boss”的你满意吗?或者说它毫无意义。例如,ATM 的“PayBill”通过了老板测试,但“选择付款选项”则没有。
  • 大小测试:一个真实的用例,具有一定的大小[场景],而不是一步
  • 完成的用例:作为用例的结果,用户应该获得真正的好处。

最后,

用例主要是文本:[场景]而不是图表。图表只是
给出功能需求的概述。但仅仅概述不
详情

First

Use-Cases simply describe "what a user can do with your system".

This simple definion sometimes confuse many people:

When we ask what can user do with your System, they tell the
options-menus on early protype GUI.

In your problem, I think you also talk about "GUI". As I understand you have a GUI prototype,
In which User choose "X Module" option, then you show user "X1,X1,X3" suboptions actions...

Use Cases "does not interested in" your GUI details. It try to capture the real "motivation"...

To make it clear: Suppose that you are designing that classic ATM Machine for a Bank.

What a user wanted to make with an ATM? Suppose that he wanted to Pay his bills from ATM...

Simple Use Case Digram For this:

enter image description here

But how he will pay his/her bills? This is captured by use case descriptions[ not diagram, use case text]...
And suppose that our client say that User can pay those kind of bills: his/her CellPhone Bill, his/her Electricity Bill, may be His/her tax. And you capture that each of these payings have different characteristics.

And you start writing your use case description in [ System do this, Actor do this] form

Use Case : Pay Bill
...................

Main Scenario:

  1. System show ATM operations
  2. User chose PayBill Options
  3. System show those Pay Bill Operations

    A) Pay CellPhone Bill

    B) Pay Electricity Bill

    C)...

  4. User Select an options

  5. If User Select Pay Cell Phone Bill Then

    5.a) System ask for CellPhone Number..

    ........
    .......

    5.n) System ask for if user want recipt

    5.n+1) User want a receipt

    5.n+2) System give a receipt
    .....

    .....

  6. If User Select Pay Electricity Bill Then
    .....
    ...

  7. If User Selects X Options Then
    ....
    ....

As a general rule do not make dirty your use case diagram with lots of
"extends" or "include", "generalize"

So as a result: We can not know if "change map view" or "view location" is a real use case [ which we should show in diagram] or just a step in a use case senario. Those are depends on your context...

As a practical advice you can apply Craig Larman 3 tests in order to find if those are real use cases:

  • Boss Test: Think like a "Boss". And tell the actor[think actor as your employee] "change view". Does this satisfy you as "Boss". Or it is meanigless. For example "PayBill" for ATM pass boss test but "choose paying options " does not.
  • Size Test: A real use case, has some size[scenarious] not a single step
  • A use case is complete: As a result of use case the user should got a real benefit.

Finally,

Use Cases are mainly texts:[Scenarious] Not Diagrams. Diagrams just
give an overview of functional requirements. But just overview not
details

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文