透明组合模式类图
2021-11-03 17:51:49 6 举报
广东金融学院有多个校区:本部、肇庆校区和清远校区,校区都要教学处(部)、学工处(部)、后勤处(部),每个机构都有自己的职责工作。请使用组合模式完成学校、校区和部门之间的结构。
作者其他创作
大纲/内容
TeachingServiceDepartment
- name:String
+ TeachingServiceDepartment(String name)+ add(Institution institution): void+ delete(Institution institution): void+ get(int index): Institution+ action(): void
Campus
- name:String- institutions:ArrayList
+ Campus(String name)+ add(Institution institution): void+ delete(Institution institution): void+ get(int index): Institution+ action(): void
LogisticsDepartment
+ LogisticsDepartment(String name)+ add(Institution institution): void+ delete(Institution institution): void+ get(int index): Institution+ action(): void
StudentAffairsDepartment
+ StudentAffairsDepartment(String name)+ add(Institution institution): void+ delete(Institution institution): void+ get(int index): Institution+ action(): void
institutions
<abstract>Institution
+ add(Institution institution):void+ delete(Institution institution):void+ get(int index):Institution+ action():void
public void action() {for(Object obj:institutions) { ((Institution) obj).action(); } }
0 条评论
下一页