火龙果·整理 uml.org.cn 1.3面向对象技术(3/6) 结构化方法Vs.面向对象(续1) main Account credit perform transaction debit A credit debit compute interest compute fees if checking if checking CheckingAccount SavingsAccount then xxx then xxx if savings if savings compute interest compute interest then xxx then xxx compute fees compute fees etc. etc. 17/336
17/336 1.3 面向对象技术(3/6) • 结构化方法Vs.面向对象 ( 续1) main perform transaction compute fees if checking then xxx if savings then xxx etc. compute interest if checking then xxx if savings then xxx etc. credit debit Account credit debit SavingsAccount compute interest compute fees CheckingAccount compute interest compute fees
火龙果·整理 uml.org.cn 1.3面向对象技术(4/6) 结构化方法Vs.面向对象(续2) If account is of type checking then do something else if account is of type savings then do something else else do yet another thing endif 18/336
18/336 1.3 面向对象技术(4/6) • 结构化方法Vs.面向对象 ( 续2) If account is of type checking then do something else if account is of type savings then do something else else do yet another thing endif
火龙果·整理 uml.org.cn 1.3面向对象技术(5/6) 结构化方法Vs.面向对象(续3) 通用理念:高内聚、低耦合、有意识推迟决 策 -革命性还是演化性? 19/336
19/336 1.3 面向对象技术(5/6) • 结构化方法Vs.面向对象 ( 续3) – 通用理念:高内聚、低耦合、有意识推迟决 策 – 革命性还是演化性?
水 1.3面向对象技术(6/6) ·OO优点 -软件系统比较稳定,需求之变VS.结构之变 易于理解 ·结构化方法: 现实世界被映射为功能集合 ·OO方法:现实世界中的实体及相互关系被映射 为对象与对象间关系,实体之间的相互关系被 映射为对象间的消息发送 更好的适应性 - 一更高的可靠性 一分析与设计无鸿沟 20/336
20/336 1.3 面向对象技术(6/6) • OO优点 – 软件系统比较稳定,需求之变Vs.结构之变 – 易于理解 • 结构化方法:现实世界被映射为功能集合 • OO方法:现实世界中的实体及相互关系被映射 为对象与对象间关系,实体之间的相互关系被 映射为对象间的消息发送 – 更好的适应性 – 更高的可靠性 – 分析与设计无鸿沟
火龙果·整理 uml.org.cn 1.4面向对象领域中的基本概念TTZ ·对象和实例 ·类 封装 继承 多态 ·消息 21/336
21/336 1.4 面向对象领域中的基本概念(1/12) • 对象和实例 • 类 • 封装 • 继承 • 多态 • 消息