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.
The dashed line with the open arrow head means a dependency. The Account class depends on a Person Class.
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.
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.
发布评论
评论(5)
虚线是一个依赖项。这意味着一个类(箭头的源)依赖于另一个类(箭头的目的地)。这是一种非常抽象的关系,并且通常以刻板印象的形式用进一步的信息进行注释。
菱形或菱形表示整体/部分关系。在您的示例中,交易由帐户组成。在 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.
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
带空心箭头的虚线表示依赖关系。 Account 类依赖于 Person 类。
你指的是图表吗?或者生成代码? Netbeans 有一个 UML 模块,可以帮助您绘制类图并可以从类图生成 Java 代码。也许这可能有帮助。
The dashed line with the open arrow head means a dependency. The Account class depends on a Person Class.
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.
添加到已经提供的答案,将定义应用到提供的类图:
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.
类图
类图是一个静态图,表示应用程序的静态视图
存在类关系
Class Diagrams
Class diagram is a static diagram that represents the static view of an application
There are class relationships