简体   繁体   English

建模类图

[英]modelling class diagrams

I have just started learning UML and after completing use case I've just started class diagram... 我刚刚开始学习UML,并且在完成用例之后,我才刚刚开始类图...

I was going through some examples and one among them was under operations category like this 我正在查看一些示例,其中一个示例属于此类操作

issueBook(in bookName):Boolean

Now issuebook is an operation, but what's the deal with in and bookName 现在issuebook是一个操作,但什么是该交易inbookName

In this webpage it says do not model scaffolding code, but if we don't model in scaffolding code how we will know what operations we're going to write while coding? 此网页中,它说不对脚手架代码进行建模,但是如果我们不对脚手架代码进行建模,那么我们将如何知道编码时将要编写的操作?

Like in the given example scaffolding code, just ignore a few of the the operations? 就像在给定的示例脚手架代码中一样,只是忽略一些操作?

Also, can anyone tell what are the steps to convert scaffolding code into non-scaffolding? 此外,谁能说出将脚手架代码转换为非脚手架的步骤是什么?

now "issuebook" is an operaton..but whats the deal with "in" and "bookname" 现在“ issuebook”是一个操作符..但是“ in”和“ bookname”的关系如何

in means it's an input parameter - ie the value is read within the operation but not written. in表示它是输入参数-即在操作中读取值但不写入值。 bookName is the name of the parameter. bookName是参数的名称。

re. 回覆。 Scaffolding code, it's just advice to prevent clutter in your model. 脚手架代码,仅是防止模型混乱的建议。 For example, let's assume you have a class named BookStore with attributes address and turnover and operation issueBook() . 例如,假设您有一个名为BookStore的类,该类的属性为addressturnover和操作issueBook() That class without scaffolding would look something like this: 没有脚手架的那个类看起来像这样:

在此处输入图片说明

Whereas with scaffolding it would look something like this: 而使用脚手架则如下所示:

在此处输入图片说明

Point is the second diagram has visual clutter; 点是第二张图有视觉混乱; the first is easier to read. 第一个更容易阅读。

Whether you include the getters/setters depends on why you're drawing the diagram. 是否包括获取器/设置器取决于绘制图表的原因。 If it's to understand the domain then the getters/setters aren't necessary. 如果要了解领域,则不需要使用getter / setter。 OTOH, if it's a specification for what needs to be coded then you can add them. OTOH,如果这是需要编码的规范,则可以添加它们。 All depends on purpose of the diagram. 一切都取决于图的目的。

hth. hth。

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

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