]> git.lyx.org Git - lyx.git/blob - sigc++/doc/UML
export patch from Dekel
[lyx.git] / sigc++ / doc / UML
1 Here is a reference to the UML class diagram symbols:
2 (Taken from a number of sources.)
3
4 Class
5 -----
6 A Class description containing a 
7    ____________
8   | Class Name |
9   |------------|
10   | Attributes | 
11   |------------|
12   | Operations |
13   |____________|
14
15 Association
16 -----------
17 An association represents a physical or conceptual connection 
18 betwen objects.  This is represented by a line between the two objects.
19 If the association has a name it would often be written on top.
20
21           AssocName
22   Class1 ----------- Class2
23
24 There is a possiblity of a multidirectional association that would be 
25 represented by a diamond connecting the related sets.
26                 
27
28   Class1 -----<O>---- Class3
29                |
30             Class2
31
32 Arrows can be used to indicate the navigablity of a association.
33 So an arrow from one class to another would indicate that Class1
34 uses the services of Class2 but Class2 is not aware of Class1.
35 It also indicates that nature of Class2 scope.  Since there
36 is no aggregation relationship here, Class2 may outlive Class1
37 instances.  This would be used to indicate a pointer or reference
38 relationship.
39
40   Class1 -------> Class2
41
42 In some places it is necessary to represent that a Class can
43 be associated with a set instead of a single instance.  This
44 will be represented by a star at the end of the association.
45
46   Class1 ------->* Class2
47
48 Composition (Strong Aggregation) 
49 ---------
50 This means that Class2 is a part of Class1.  It is a strong form
51 of aggregation in that when Class1 is destroyed Class2 goes with it.
52
53 The symbol for a composition relationship is a diamond filled to an arrow.
54
55  Class1 <*>----->  Class2  
56
57 Aggregation
58 -----------
59 A weaker form of aggregation than composition is represented with
60 an unfilled diamond.  It still demotes the life time of Class2 is 
61 restricted to Class1, but Class2 is not part of Class1.  This may
62 be implemented by a pointer in Class1 to Class2 with the dtor 
63 destroying Class2.    
64
65  Class1 <>------> Class2
66  
67
68 Inheritance
69 -----------
70
71 Inheratance is indicated with an triangle pointing up to the 
72 class form which the other derives.  (Having no triangles a
73 A will do.)
74   
75 Class1
76   A
77   |
78 Class2
79
80
81 So now a quick example:
82
83          +--> Shape
84          |      A
85  parent_ |      |
86          |      |         points_
87          +--- Polygon <>------------->* Point
88
89 This would indicate that a Polygon is derived from a Shape.  It also
90 indicates that Polygon can have a reference to a Shape.  Further,
91 Polygon contains a set of Points that it is responsible for.
92
93 This might be implemented like
94
95   class Shape 
96     {//...
97     };
98
99   class Polygon: public Shape
100     {
101      private:
102        Shape*         parent_;
103        list<auto_ptr<Point>> points_;
104      public:
105        //...
106     };
107           
108      
109 References:
110   UML Class Diagrams
111     Robert C. Martin
112     Engineering Notebook Column
113     C++ Report, August, 1997 
114     http://www.oma.com/PDF/umlClassDiagrams.pdf
115
116   OML Object Model
117     http://wwwis.cs.utwente.nl:8080/dmrg/MEE/misop007/
118
119