Home  >  Q&A  >  body text

c++ - 类中有指针,又有vector,其uml图如何画

某个类的成员变量中有指针,还有vector对象,那么该如何画uml,成员变量的类型只有基本的int,char等。没有这些复杂的类型啊
还有就是一个类中包含另外一个类的对象,这是什么关系啊

怪我咯怪我咯2715 days ago729

reply all(1)I'll reply

  • 黄舟

    黄舟2017-04-17 13:41:18

    UML diagrams can contain custom types, including array objects, but they generally do not exist as in-class attributes. Because the type contained in the pointer or vector itself should also be an entity, another representation is more appropriate. The two can be connected through relationships.

    A class containing objects of another class is usually composition or aggregation. Tires and cars are a combination relationship, and wild geese and a flock of geese are an aggregation relationship.

    reply
    0
  • Cancelreply