对象图和类图有什么区别?

发布于 2024-12-07 12:08:13 字数 25 浏览 4 评论 0原文

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

Is there a difference in the meaning of "class diagram" and "object graph"?

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

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

发布评论

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

评论(3

杯别 2024-12-14 12:08:13

看这个教程
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

参见进一步

see this tutorial
http://www.cs.toronto.edu/~jm/340S/Slides6/ClassD.pdf

Object graph contains value of one instance of class see example View its a view of an object system at a particular point in time

while

class diagram as 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

see further

凯凯我们等你回来 2024-12-14 12:08:13

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

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

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

I agree with the previous post but would like to add that a class diagram is based on UML which is an accredited language sponsored by the OMG and known by over 5 millions users. UML is therefore a standard based on a model from which you get views.

IN UML 2 the class diagram is fantastic if used with Java because it seems to me that the new specification has exactly the same structure as a java project. It include a project name, with packages including classifiers (e.g. Class, interface, enum) which includes attributes, methodes which includes properties.

If you have to use just one diagram I would say to use Class diagram. It is easy to create because you don't need to know UML and can reverse engineer your project into a model a get class diagram views. My class diagram is Just magic:-)

蓝海似她心 2024-12-14 12:08:13

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

Class diagram represent class name,its attributes and behaviours whereas object diagram represent instance of class diagram,object diagram comes under class diagram

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文