UML类图 发表于 2017-04-13 | 分类于 技术 | | 阅读次数 字数统计 129 字 | 阅读时长 1 分钟 依赖关系 123456public class Person { public void doSomething(){ Card card = new Card();//局部变量 .... } } 12345public class Person { public void doSomething(Card card){//方法参数 .... } } 123456public class Person { public void doSomething(){ int id = Card.getId();//静态方法调用 ... } } 关联关系 1234567891011public class Person { public Phone phone; public void setPhone(Phone phone){ this.phone = phone; } public Phone getPhone(){ return phone; } } 聚合关系 1234567public class Team { public Person person; public Team(Person person){ this.person = person; } } 组合关系 12345678910111213public class Person { public Head head; public Body body; public Arm arm; public Leg leg; public Person(){ head = new Head(); body = new Body(); arm = new Arm(); leg = new Leg(); } } 继承关系 ------本文结束 感谢阅读------ 本文作者: cipher 本文链接: http://www.ciphermagic.cn/uml.html 版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 CN 许可协议。转载请注明出处!