生成类图的工具

Tool to generate class diagram?

本文关键字:工具      更新时间:2023-10-16

我有这些c++类:

class sales{
private:
    float dollar[3];
public:
    void getData(float f1,float f2, float f3){
        dollar[0]=f1;// sales of first month
        dollar[1]=f2;// sales of second month
        dollar[2]=f3;// sales of third month
    }
    void putData(){
        int count=0;
        while(count!=3){
        cout<<dollar[count]<<"t$"<<endl;
        count++;
        }
    }
};

class publication:public sales{
private:
    string PubName;
    int PubYear;
public:
    void SetName(string s){
        PubName=s;
    }
    string GetName(){
        return PubName;
    }
        void SetYear(int y){
        PubYear=y;
    }
    int GetYear(){
        return PubYear;
    }
};
class book:public publication{
private:
    string Author;
public:
    void SetAuthor(string a){
        Author=a;
    }
    string GetAuthor(){
        return Author;
    }

};
class tape:public publication{
private:
    string singer;
public:
    void SetSinger(string s){
        singer=s;
    }
    string GetSinger(){
        return singer;
    }

};

我想自动生成一个类图,是否有在线有用的工具来做到这一点?

StarUML有一个逆向工程选项,它将根据您的源代码生成UML图(它是免费的,但不是在线的)。但通常情况下,在编写任何一行代码之前,您应该先制作一个图表。

使用氧,它易于使用,为您提供开箱即用的图形,并且非常适合记录您的代码-最重要的是:它是免费的。

有一些(寻找反向代码工程)。我个人使用企业架构师从http://www.sparxsystems.com/

这可能比您需要的更多,但您可以尝试ArgoUML:

ArgoUML主页

如果你使用Web start链接,它几乎就像一个在线工具。