forked from MontiCore/cd4analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyCompany.cd
More file actions
35 lines (31 loc) · 789 Bytes
/
MyCompany.cd
File metadata and controls
35 lines (31 loc) · 789 Bytes
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
/* (c) https://github.com/MontiCore/monticore */
//package corp;
import java.util.Date;
classdiagram MyCompany {
enum CorpKind { SOLE_PROPRIETOR, S_CORP, C_CORP, B_CORP, CLOSE_CORP, NON_PROFIT; }
abstract class Entity;
package people {
class Person extends Entity {
Date birthday;
List<String> nickNames;
-> people.Address [*] {ordered};
}
class Address {
String city;
String street;
int number;
}
}
class Company extends Entity {
CorpKind kind;
}
class Employee extends people.Person {
int salary;
}
class Share {
int value;
}
association [1..*] Company (employer) <-> Employee [*];
composition [1] Company <- Share [*];
association shareholding [1] Entity (shareholder) -- (owns) Share [*];
}