0%

Mermaid 语法学习 -- 类图

Mermaid 画类图

代码如下 :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
classDiagram
class DataBaseOperation {
-connectionString : string

+DataBaseOperation()
+ConnectionString()string


+ExecuteDataSet(in commandText : string)DataSet
+ExecuteDataSet(in commandText : string, in commandType : CommandType)DataSet
+ExecuteDataSet(in commandText : string, in commandType : CommandType, in parameters : params OracleParameter[])DataSet

+ExecuteReader(in commandText : string)OracleDataReader
+ExecuteReader(in commandText : string, in commandType : CommandType)OracleDataReader
+ExecuteReader(in commandText : string, in commandType : CommandType, in parameters : OracleParameter[])OracleDataReader

+ExecuteScalar(in commandText : string)object
+ExecuteScalar(in commandText : string, in commandType : CommandType)object
+ExecuteScalar(in commandText : string, in commandType : CommandType, in parameters : OracleParameter[])object

+ExecuteNonQuery(in commandText : string)int
+ExecuteNonQuery(in commandText : string, in commandType : CommandType)int
+ExecuteNonQuery(in commandText : string, in commandType : CommandType, in parameters : OracleParameter[])int

+ExecuteSqls(in sqlStrings : List<string>)int
+ExecuteSqls(in sqlStrings : List<string>, in commandTypeList : List<System.Data.CommandType>)int
+ExecuteSqls(in sqlStrings : List<string>, in commandTypeList : List<System.Data.CommandType>, in parametersList : List)int
}

class B {
+A : int
+B()int
}

DataBaseOperation --> B
DataBaseOperation ..> B
DataBaseOperation ..|> B
DataBaseOperation --|> B

渲染失效的话,在 https://www.min2k.com/tools/mermaid/ 提交代码即可渲染

classDiagram
class DataBaseOperation {
    -connectionString : string

    +DataBaseOperation()
    +ConnectionString()string


    +ExecuteDataSet(in commandText : string)DataSet
    +ExecuteDataSet(in commandText : string, in commandType : CommandType)DataSet
    +ExecuteDataSet(in commandText : string, in commandType : CommandType, in parameters : params OracleParameter[])DataSet

    +ExecuteReader(in commandText : string)OracleDataReader
    +ExecuteReader(in commandText : string, in commandType : CommandType)OracleDataReader
    +ExecuteReader(in commandText : string, in commandType : CommandType, in parameters : OracleParameter[])OracleDataReader

    +ExecuteScalar(in commandText : string)object
    +ExecuteScalar(in commandText : string, in commandType : CommandType)object
    +ExecuteScalar(in commandText : string, in commandType : CommandType, in parameters : OracleParameter[])object

    +ExecuteNonQuery(in commandText : string)int
    +ExecuteNonQuery(in commandText : string, in commandType : CommandType)int
    +ExecuteNonQuery(in commandText : string, in commandType : CommandType, in parameters : OracleParameter[])int

    +ExecuteSqls(in sqlStrings : List)int
    +ExecuteSqls(in sqlStrings : List, in commandTypeList : List)int
    +ExecuteSqls(in sqlStrings : List, in commandTypeList : List, in parametersList : List)int
}

class B {
    +A : int  
    +B()int
}

DataBaseOperation --> B
DataBaseOperation ..> B
DataBaseOperation ..|> B
DataBaseOperation --|> B