简体   繁体   English

UML-类模型问题

[英]UML - class model question

I have started to study UML standard and would need little help with two things I cannot find. 我已经开始研究UML标准,并且在我找不到的两件事上几乎不需要帮助。 I understand that in the class model I should design classes and their relations like: 我了解在类模型中,我应该设计类及其关系,例如:

Customer<>--->(*1)Items ordered 客户<> --->(* 1)已订购商品

1)Is it correct that we design only "our" custom classes and do not care about classes used inside like Dictionary,List....? 1)我们只设计“我们的”自定义类,而不关心字典,列表等中使用的类是否正确?

2)What kind of relation is between server and clients (if each client is a class)? 2)服务器和客户端之间是什么样的关系(如果每个客户端都是一个类)? It is simple associative relation ServerClass---->*Client class or agregation because client classes are created and maintained by server class? 这是简单的关联关系ServerClass ----> * Client类或聚合,因为客户端类是由服务器类创建和维护的? I guess its agregation but then I cannot think of any associative relation since there is always some master class. 我猜想它的聚集,但是因为总有一些大师班,所以我想不出任何关联关系。

Thank you! 谢谢!

1) Typically, framework classes are not drawn. 1)通常,不绘制框架类。 For list you just add the multiplicity > 1 (eg 1..*) to indicate that there are multiple items. 对于列表,您只需添加多重性> 1(例如1 .. *)以表明存在多个项目。 UML is a language, ie a communication tool, thus, if the reader understands what you mean, you use the language well, if not, you may be more specific. UML是一种语言,即一种交流工具,因此,如果读者理解您的意思,那么您会很好地使用该语言,否则,您可能会更加具体。

2) Be careful not to mix up objects and classes. 2)注意不要混淆对象和类。 Your if you have indeed multiple client classes, you can model all of them, if you on the other hand, have multiple client instances managed by the server, then in a class diagram you just make a one to many relationship from server to client. 如果确实有多个客户端类,则可以对它们全部进行建模,另一方面,如果有多个客户端实例由服务器管理,则在类图中,您只需在服务器与客户端之间建立一对多关系。

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

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