面向过程开发模式的特点 a过程性开发模式侧重建立构成问题解 决的处理流。 a数据抽象、数据结构根据算法步骤的 要求开发,它贯穿于过程,提供过程 所要求操作的信息。 系统的状态是一组全局变量,这组全 局变量保存状态的值,把它们从一个 过程传送到另一个过程
过程性系统 初始化读入 计算 写出 结束 (a)系统结构基于要执行的任务,改变一个可能需要改变其它所有的 面向对象的系统 (b)系统结构基于对象间的交互,改变一个通常只具有局部影响
事件处理循环 case mouse create 初始化系统建立和显示 和全局变量「界面 keypress- quit 系统 停工 expose refresh (1) Initialize system; (2)Create and draw interfaces while quit not selected de case
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 loops else ignore; Ecpose event: refresh display by drawing each shape structure (4)Shut down system;
面向对象开发模式 a在面向过程开发模式中优先考虑的 是过程抽象,在面向对象开发模式 中优先考虑的是实体(问题论域的 对象)。 a在面向对象开发模式中,把标识和 模型化间题论域中的主要实体做为 系统开发的起点,主要考虑对象的 行为而不是必须执行的一系列动作