File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
tests/pyreverse/functional/class_diagrams/aggregation Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -4,24 +4,22 @@ class P:
4
4
pass
5
5
6
6
class A :
7
- x : P # just type hint, no ownership, so association
7
+ x : P # just type hint, no ownership → Association
8
8
9
9
class B :
10
10
def __init__ (self , x : P ):
11
- self .x = x # not instantiated, so aggregation
11
+ self .x = x # receives object, not created → Aggregation
12
12
13
13
class C :
14
14
x : P
15
-
16
15
def __init__ (self , x : P ):
17
- self .x = x # not instantiated, so aggregation
16
+ self .x = x # receives object, not created → Aggregation
18
17
19
18
class D :
20
19
x : P
21
-
22
20
def __init__ (self ):
23
- self .x = P () # instantiated, so composition
21
+ self .x = P () # creates object → Composition
24
22
25
23
class E :
26
24
def __init__ (self ):
27
- self .x = P () # instantiated, so composition
25
+ self .x = P () # creates object → Composition
You can’t perform that action at this time.
0 commit comments