理解类图

发布于 2024-08-14 02:43:42 字数 314 浏览 4 评论 0 原文

谁能解释一下连接器的含义吗?

替代文本
(来源:stsmedia.net

什么免费软件可以生成这样的图吗?

Can anyone explain what the connectors mean?

alt text
(source: stsmedia.net)

What freeware can generate a diagram like this?

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

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

发布评论

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

评论(5

笑叹一世浮沉 2024-08-21 02:43:42

虚线是一个依赖项。这意味着一个类(箭头的源)依赖于另一个类(箭头的目的地)。这是一种非常抽象的关系,并且通常以刻板印象的形式用进一步的信息进行注释。

菱形或菱形表示整体/部分关系。在您的示例中,交易帐户组成。在 UML 中,白菱形是整体/部分(聚合)的较弱类型,而黑菱形是较强的种类,通常称为组合。不过,这些的语义定义不明确,并且已被证明是有缺陷的。

三角形表示泛化关系。它们意味着类的集合(三角形箭头的源)是更广义的类(三角形箭头的目的地)的特化。在您的示例中,贷款是一种产品。

有很多工具可以绘制结构图或类图。关于免费工具,请在此处查看维基百科。

The dashed (dotted) line is a dependency. It means that a class (source of the arrow) depends on another class (destination of the arrow). This is a very abstract kind of relationship, and is often annotated with further information in the form of stereotypes.

The diamond or rhombus means a whole/part relationship. In your example, a Transaction is made of Accounts. In UML, a white diamond is a weaker flavour of whole/part (aggregation), whereas a black diamond is a stronger variety, often called a composition. The semantics of these are poorly defined and have been shown to be flawed, though.

Triangles mean generalisation relationships. They mean that a collection of classes (sources of the triangle-pointed arrows) are specialisations of more generalised classes (destination of the triangle-pointed arrow). In your example, a Loan is a type of Product.

There are many tools that can draw structural or class diagrams. About free ones, have a look at Wikipedia here.

夜吻♂芭芘 2024-08-21 02:43:42

UML 有一个标准,但并非所有人都遵守它。在 wikipedia 上查找 Class_diagram

Visio 是创建它们的 Microsoft Office 软件,在 google 上快速搜索 Eclipse (Java) 会看到这个 http://www.mvmsoft.de/content/plugins/slime/index.htm

UML has a standard, however not all people adhere to it. At wikipedia look up Class_diagram

Visio is the Microsoft Office software to create them, and a quick google search for Eclipse (Java) brings this http://www.mvmsoft.de/content/plugins/slime/index.htm

溺渁∝ 2024-08-21 02:43:42
  1. 带空心箭头的虚线表示依赖关系。 Account 类依赖于 Person 类。

  2. 你指的是图表吗?或者生成代码? Netbeans 有一个 UML 模块,可以帮助您绘制类图并可以从类图生成 Java 代码。也许这可能有帮助。

  1. The dashed line with the open arrow head means a dependency. The Account class depends on a Person Class.

  2. Do you mean the diagram? Or generating code? Netbeans has a UML module that assist you in drawing class diagrams and can generate Java code from the class diagrams. Maybe that might help.

一个人的旅程 2024-08-21 02:43:42

添加到已经提供的答案,将定义应用到提供的类图:

Person 的实例将包含 Account 的实例,因为这是一个
聚合关系(由白色菱形表示)它意味着
的一个实例
Account 可以独立于 Person 的实例而存在。由于细节的多样性
没有提供,不能说一个人实例有多少个帐户实例
可以包含。

类似的解释也适用于交易和贷款之间的关系,
人和贷款。

正如所回答的,三角形定义了泛化关系,这意味着继承。
对于提供的类图,这意味着类 Loan、ManagedFund 和 Cash
是产品类的专业化。 Loan 的实例将包含属性
其中定义的(利息、贷方)并且还包含
父类中定义的属性name,description和managementFee
产品。

Adding to the already provided answers, applying the definitions to the provided class diagram:

An instance of Person would contain an instance of Account and since this is an
aggregation relation (represented by white diamond) it implies that an instance of
Account can exist independently of an instance of Person. Since the multiplicity details
are not provided it cannot be said how many instances of an Account a Person instance
can contain.

Similar explanation holds good for the relation between Transaction and Loan,
Person and Loan.

As answered Triangles define generalization relations and this implies inheritance.
For the provided class diagram this implies that classes Loan, ManagedFund, and Cash
are specializations of the class Product. An instance of Loan would contain attributes
that are defined in it (interest, lenders) and also would contain the
attributes name,description and managementFee that are defined in the parent class
Product.

流星番茄 2024-08-21 02:43:42

类图

类图是一个静态图,表示应用程序的静态视图

存在类关系

  • 关联 -(关联的确定在某种程度上与 ER 图的创建有关)
  • 攻击 -(特定的类可能包含本身代表类的组件数量)
  • 组合 - (如果没有容器对象,包含对象的更强攻击形式就不可能存在)
  • 泛化 - (代表继承的思想)

Class Diagrams

Class diagram is a static diagram that represents the static view of an application

There are class relationships

  • Association - (Determination of association is somewhat related to creation of ER diagram)
  • Aggression - (A particular class might consist of no of components that represent classes by itself)
  • Composition - (Stronger form of aggression contained objects cannot be exist without the container object)
  • Generalization - (Represent the idea of inheritance)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文