0

“类图”和“对象图”的含义有区别吗?

4

3 回答 3

1

请参阅本教程 http://www.cs.toronto.edu/~jm/340S/Slides6/ClassD.pdf

对象图包含一个类实例的值 查看示例 查看其在特定时间点的对象系统视图

尽管

类图作为wiki

The class diagram is the main building block of object oriented modelling. It is used both for general conceptual modelling of the systematics of the application, and for detailed modelling translating the models into programming code. Class diagrams can also be used for data modeling.[1] The classes in a class diagram represent both the main objects and or interactions in the application and the objects to be programmed. In the class diagram these classes are represented with boxes which contain three parts: [2]


A class with three sections.
The upper part holds the name of the class
The middle part contains the attributes of the class
The bottom part gives the methods or operations the class can take or undertake

进一步

于 2011-09-30T08:23:30.830 回答
1

我同意上一篇文章,但想补充一点,类图是基于 UML 的,UML 是一种由 OMG 赞助并为超过 500 万用户所知的认可语言。因此,UML 是一种基于模型的标准,您可以从中获取视图。

在 UML 2 中,如果与 Java 一起使用,类图非常棒,因为在我看来,新规范与 Java 项目具有完全相同的结构。它包括一个项目名称,包包括包括属性的分类器(例如类、接口、枚举),包括属性的方法。

如果您只需要使用一张图,我会说使用类图。它很容易创建,因为您不需要了解 UML,并且可以将您的项目逆向工程为模型以获得类图视图。我的类图只是魔术:-)

于 2011-09-30T12:01:25.083 回答
0

类图表示类名,其属性和行为,而对象图表示类图的实例,对象图属于类图

于 2017-06-02T15:55:48.673 回答