[译]OOSE第4章:面向对象系统的研发 4.4 面向对象的集成Object-oriented construction

4.4 Object-oriented construction

面向对象的集成

Object-oriented construction means that the analysis model is designed and implemented in source code. This source code is executed in the target environment, which often means that the ideal model produced by the analysis model must be molded to fit into the implementation environment.

面向对象的集成意味着分析模型会进一步的设计和集成为源代码。这些源代码最终会在目标的计算环境中运行,这就意味着在分析模型中设计的理想模型,最终需要再次进行重新构成可以适配到集成环境中的实施模型。

As with all design activities, it is difficult to achieve a good balance between structure and efficiency. The analysis model has provided us with an ideal structure which we shall try to keep as long as possible. It is, as you know, modification resistant. During the design, though, one must take care to follow all restrictive demands on the system, (for example, demands of the target environment, maximum memory usage, reliability and response times). All this can affect the structure.

因为在所有设计活动中,如何在系统结构和执行效率中进行有效的平衡是非常困难的。分析模型的目的是为设计人员提供一个理想的结构,依托这个分析模型我们能够在项目的生命周期中尽可能保障系统架构的持久和稳定。这一点,就是大家了解的,系统需求变更适配(modification resistant)。在设计的过程中,设计者还必须关注其他的一些系统设计的限制性因素(举个例子来说,目标环境的需求,最大的内存使用,可靠性和响应时间)。所有这些因素都有可能影响系统结构。

The goal is that the objects identified during the analysis should also be found within the design. We call this traceability. We must therefore have straightforward rules for transforming the analysis model into a design model and the programming language.

在OOSE的设计过程中,有一个重要的目标在于在分析模型中确定的对象列表也必须在设计模型中出现。我们把这种设计要求叫做可追踪性分析,我们必须,应用非常直接规则来把分析模型转换为设计模型,以及编程语言。

The objects may be implemented using previously developed source code. We call such parts components. Such components are often simpler to create in an object-oriented environment, owing to the integration of functions and data.

在OO的设计过程中,有一些对象可以直接使用前期项目中已经开发的源代码。我们把这一部分重用的部分叫做组件。这些组件通常是非常容易在面向对象的环境中创建,因为在组件中功能和数据是完全的集成在一起的。

Previously, we mentioned that object-oriented programming demands object-oriented system development as, otherwise, a difficult paradigm shift will occur. The opposite procedure, to go from object-oriented analysis to traditional programming, also incurs a paradigm shift. However, this causes less of a problem as, even for non-object-oriented languages, we can structure the system to be object-oriented. Additionally, we can program in an object-oriented style, even for other languages (see Jacky and Kalet (1987) or Linowes (1988)). Hence object-orientation is also a style of programming and not only the name of a programming language family having language constructs such as inheritance, encapsulation and polymorphism. A paradigm shift will occur, but it can be made relatively smooth. We shall later see that if we have, for example, a relational database, which is typically function/data oriented, we can incorporate this inside the objects and perform the paradigm shift locally.

 

前面,我们已经提到面向对象的编程,需要依赖前期面向对象的设计过程,否则后期将会发生非常困难的设计范例漂移paradigm shift。然而相反的过程,从面向对象的分析转换到后续传统编程方法,也会产生其他的设计范例漂移paradigm shift。但是这种偏移带来的影响并不大,即便后续的程序设计语言是一种非面向对象的编程语言,我们可以非常方便的让系统具备面向对象的特点。此外,无论即使是采用其他的编程语言,我们也可以通过一种面向对象的方式来集成。所以面向对象的其实从本质上是一种编程的模式,而不仅仅是一种面向对象的编程语言的名称,通常面向对象的编程语言能够非常方便支持继承,封装和多态。虽然,从面向对象的分析到后续的实施也可能发生范例迁移,但是我们可以相对平滑的处理这种迁移过程。后续我们将会看到,举个例子来说,在传统的F/D方法中应用的数据库,我们可以把他非常方便的集成在对象内部,而把这种范例迁移控制在局部的范围。

Of course, many good techniques have been developed in function/data methods, which can also be used in object-oriented methods. Just because we shift paradigm, we should not forget all that we have learned. An example of a technique usable within object-orientation is state diagrams. In the chapter on construction, we shall see how these can be used to describe an object.

当然,在F/D方法中也发展可很多非常好的技能,这些技能也可以在面向对象的设计方法中应用。虽然我们进行了设计范例的转换,我们不应该忘记前期我们所掌握的系统分析的技能。其中一个例子就是状态转移图,这种分析方法在面向对象的设计过程中也同样适用。在后续介绍面向对象集成的章节,我们会学习如何利用状态转移图来描述一个对象。

 

 

 

修订版本 

 

 

4.4 Object-oriented construction

面向对象的集成

Object-oriented construction means that the analysis model is designed and implemented in source code. This source code is executed in the target environment, which often means that the ideal model produced by the analysis model must be molded to fit into the implementation environment.

面向对象的集成意味着分析模型会进一步的设计和实现为源代码。这些源代码最终会在目标的计算环境中运行,这往往意味着在分析模型中设计的理想模型,最终需要行一些调整,以适应最终的实现模型。

As with all design activities, it is difficult to achieve a good balance between structure and efficiency. The analysis model has provided us with an ideal structure which we shall try to keep as long as possible. It is, as you know, modification resistant. During the design, though, one must take care to follow all restrictive demands on the system, (for example, demands of the target environment, maximum memory usage, reliability and response times). All this can affect the structure.

正如所有设计活动一样,在系统结构和执行效率之间进行有效的平衡是非常困难的。分析模型提供了一个理想的结构,我们应尽可能保证这种结构的稳定性。这一点,就是大家所了解的“变更适应能力”(modification resistant)。在设计过程中,设计者还必须关注其他的一些系统设计的限制性因素(例如,目标环境的需求,最大的内存使用,可靠性和响应时间)。所有这些因素都有可能影响系统结构。

The goal is that the objects identified during the analysis should also be found within the design. We call this traceability. We must therefore have straightforward rules for transforming the analysis model into a design model and the programming language.

OOSE的设计过程中,有一个重要的目标在于在分析模型中确定的对象列表也必须在设计模型中出现。我们把这叫做可追踪性,我们必须应用非常直接的规则来把分析模型转换为设计模型以及编程语言。

The objects may be implemented using previously developed source code. We call such parts components. Such components are often simpler to create in an object-oriented environment, owing to the integration of functions and data.

OO的设计过程中,有一些对象可以直接使用前期项目中已经开发的源代码。我们把它们称做组件。这种组件通常更容易在面向对象的环境中创建,因为在面向对象的环境下,功能和数据是集成在一起的。

Previously, we mentioned that object-oriented programming demands object-oriented system development as, otherwise, a difficult paradigm shift will occur. The opposite procedure, to go from object-oriented analysis to traditional programming, also incurs a paradigm shift. However, this causes less of a problem as, even for non-object-oriented languages, we can structure the system to be object-oriented. Additionally, we can program in an object-oriented style, even for other languages (see Jacky and Kalet (1987) or Linowes (1988)). Hence object-orientation is also a style of programming and not only the name of a programming language family having language constructs such as inheritance, encapsulation and polymorphism. A paradigm shift will occur, but it can be made relatively smooth. We shall later see that if we have, for example, a relational database, which is typically function/data oriented, we can incorporate this inside the objects and perform the paradigm shift locally.

前面我们已经提到,面向对象的编程要求前期采用面向对象的设计,否则需要进行一次非常困难的思维转换。然而一个相反的过程即:先有面向对象的设计,然后使用传统的编程方法,同样也需要思维转换。但这种转换会相对容易。使用非面向对象的编程语言,可以很容易地写出面向对象风格的代码。所以面向对象其实也是一种编程的风格,而不仅仅是指那些能支持继承,封装和多态的编程语言。采用这种编程风格,需要一些思维转换,但相对容易。例如我们后面会看到,对于传统的面向F/D的关系型数据库,我们可以把它非常方便的集成在对象内部,而把这种思维转换控制在局部的范围。

Of course, many good techniques have been developed in function/data methods, which can also be used in object-oriented methods. Just because we shift paradigm, we should not forget all that we have learned. An example of a technique usable within object-orientation is state diagrams. In the chapter on construction, we shall see how these can be used to describe an object.

当然,在F/D方法中也有很多非常好的技术也可以在面向对象的方法中加以应用。尽管我们进行了思维转换,我们也不应该忘记前期我们所掌握的系统分析技能。其中一个例子就是状态转移图,这种分析方法在面向对象的设计过程中也同样适用。在后续的介绍面向对象集成的章节,我们会学习如何利用状态转移图来描述一个对象。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
面向对象软件工程(OOSE)是一种软件开发方法,它将现实世界中的对象、类和方法等概念应用于软件开发中。下面是OOSE的优缺点和方法: 优点: 1. 代码重用性高:面向对象的思想使得程序员可以设计和实现可重用的代码模块,提高了开发效率和代码质量。 2. 模块化:面向对象的开发方法可以将软件系统分解成多个模块,每个模块都有自己的数据和功能,这种模块化的设计使得软件系统易于维护和升级。 3. 可扩展性:面向对象的开发方法可以使得系统易于扩展和修改,添加新的功能或修改原有的功能都可以通过修改相应的类实现。 4. 代码可读性高:面向对象编程风格使得代码易于理解和阅读,有助于减少代码维护的成本。 缺点: 1. 学习曲线陡峭:面向对象的开发方法需要学习面向对象的概念和原则,初学者可能需要投入更多的时间和精力来掌握这种编程方法。 2. 设计复杂度高:面向对象的开发方法需要在设计阶段,仔细考虑类和对象之间的关系、继承等问题,这会增加系统设计的复杂度和难度。 3. 性能问题:面向对象编程风格可能会对程序的性能产生一定的影响,需要在实现过程中注意优化策略。 方法: 1. 需求分析:在软件开发的初期,需要对需求进行分析和设计,确定系统功能和结构。 2. 设计:设计阶段需要考虑类和对象之间的关系、继承、多态等问题,设计出系统的类图和对象图。 3. 实现:在实现阶段,需要按照设计阶段的要求,将类和对象转化为代码实现。 4. 测试:测试阶段需要对系统进行测试,并对测试结果进行分析和改善。 5. 维护:在系统投入使用后,需要对系统进行维护和更新,保证系统的稳定性和可靠性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值