面向对象程序设计外文翻译2
《面向对象程序设计外文翻译2》由会员分享,可在线阅读,更多相关《面向对象程序设计外文翻译2(10页珍藏版)》请在毕设资料网上搜索。
1、 附录 1. 外文文献 Introduction To Objects 1、 The progress of abstraction All programming languages provide abstractions. It can be argued that the complexity of the problems youre able to solve is directly related to the kind and quality of abstraction. By “kind” I mean, “What is it that you are abstracti
2、ng?” Assembly language is a small abstraction of the underlying machine. Many so-called “imperative” languages that followed (such as FORTRAN, BASIC, and C) were abstractions of assembly language. These languages are big improvements over assembly language, but their primary abstraction still requir
3、es you to think in terms of the structure of the computer rather than the structure of the problem you are trying to solve. The programmer must establish the association between the machine model (in the “solution space,” which is the place where youre modeling that problem, such as a computer) and
4、the model of the problem that is actually being solved (in the “problem space,” which is the place where the problem exists). The effort required to perform this mapping, and the fact that it is extrinsic to the programming language, produces programs that are difficult to write and expensive to mai
5、ntain, and as a side effect created the entire “programming methods” industry. The alternative to modeling the machine is to model the problem youre trying to solve. Early languages such as LISP and APL chose particular views of the world (“All problems are ultimately lists” or “All problems are alg
6、orithmic,” respectively). PROLOG casts all problems into chains of decisions. Languages have been created for constraint-based programming and for programming exclusively by manipulating graphical symbols. (The latter proved to be too restrictive.) Each of these approaches is a good solution to the
7、particular class of problem theyre designed to solve, but when you step outside of that domain they become awkward. The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space. This representation is general enough that the progra
8、mmer is not constrained to any particular type of problem. We refer to the elements in the problem space and their representations in the solution space as “objects.” (You will also need other objects that dont have problem-space analogs.) The idea is that the program is allowed to adapt itself to t
9、he lingo of the problem by adding new types of objects, so when you read the code describing the solution, youre reading words that also express the problem. This is a more flexible and powerful language abstraction than what weve had before. Thus, OOP allows you to describe the problem in terms of
10、the problem, rather than in terms of the computer where the solution will run. Theres still a connection back to the computer: each object looks quite a bit like a little computerit has a state, and it has operations that you can ask it to perform. However, this doesnt seem like such a bad analogy t
11、o objects in the real worldthey all have characteristics and behaviors. Alan Kay summarized five basic characteristics of Smalltalk, the first successful object-oriented language and one of the languages upon which Java is based. These characteristics represent a pure approach to object-oriented pro
12、gramming: Everything is an object. Think of an object as a fancy variable; it stores data, but you can “make requests” to that object, asking it to perform operations on itself. In theory, you can take any conceptual component in the problem youre trying to solve (dogs, buildings, services, etc.) an
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中设计图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 面向 对象 程序设计 外文 翻译
