Class Diagram - How to describe a graph datatype?

99封情书 提交于 2019-12-12 02:18:24

问题


How do I represent a graph data-type in a class diagram

Class Diagram: http://www.uml-diagrams.org/class-diagrams.html

Do I have to specify how graph data-type is implemented? Or is there a symbol to denote a graph?


回答1:


UML itself includes diagrams that are graphs (state machine diagrams, activity diagrams) but will not provide what you are expecting.

UML is originally conceived for object-oriented programming, not programming in general. It will allow you to represent object-oriented features, not general programming features (as graphs are not object-oriented features).

So you will be able to represent a Graph class as a class, not as a graph data type. Graph are abstract data types, it is up to the programmer to implement (it will be highly related to the way you are programming, you can manage graphs without OOP).



来源:https://stackoverflow.com/questions/27804290/class-diagram-how-to-describe-a-graph-datatype

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!