面向过程开发模式的特点 0过程性开发模式侧重建立构成问题解 决的处理流。 a数据抽象、数据结构根据算法步骤的 要求开发,它贯穿于过程,提供过程 所要求操作的信息。 a系统的状态是一组全局变量,这组全 局变量保存状态的值,把它们从一个 过程传送到另一个过程
面向过程开发模式的特点 过程性开发模式侧重建立构成问题解 决的处理流。 数据抽象、数据结构根据算法步骤的 要求开发,它贯穿于过程,提供过程 所要求操作的信息。 系统的状态是一组全局变量,这组全 局变量保存状态的值,把它们从一个 过程传送到另一个过程
过程性系统 初始化一读入 计算 写出 结束 a)系统结构基于要执行的任务,改变一个可能需要改变其它所有的 面向对象的系统 b)系统结构基于对象间的交互,改变一个通常只具有局部影响
事件处理循环 case mouse create 初始化系统、建立和显示 keypressquit 系统 和全局变量 界面 停工 expose-frefresh (2) Initialize system; (2 Create and draw interface; while QUiT not selected do case
⑴ Initialize system; ⑵ Create and draw interface; while QUIT not selected do case
Mouse event: create shape structure; read mouse movements for data; store newly created shape on list of shape records, Keypress event if key =g then exit loop; else ignore; Ecpose event: refresh display by drawing each shape structure; Shut down system;
Mouse event: create shape structure; read mouse movements for data; store newly created shape on list of shape records; KeyPress event: if key = 'q' then exit loop; else ignore; Ecpose event: refresh display by drawing each shape structure; ⑷ Shut down system;
而向对象开发模式 0在面向过程开发模式中优先考虑的是 过程抽象,在面向对象开发模式中优 先考虑的是实体(问题论城的对象)。 a在面向对象开发模式中,把标识和模 型化问题起的主要实体做为系统 开发的起点,主要考虑对象的行为而 不是必须执行的一系列动作
面向对象开发模式 在面向过程开发模式中优先考虑的是 过程抽象,在面向对象开发模式中优 先考虑的是实体(问题论域的对象)。 在面向对象开发模式中,把标识和模 型化问题论域中的主要实体做为系统 开发的起点,主要考虑对象的行为而 不是必须执行的一系列动作