The history of software development is a history of raising the level of abstraction. Our industry used to build systems by soldering wires together to form hard-wired programs. Machine code let us store programs by manipulating switches to enter each instruction. Data was stored on drums whose rotation time had to be taken into account so that the head would be able to read the next instruction at exactly the right time. Later, assemblers took on the tedious task of generating sequences of ones and zeroes from a set of mnemonics designed for each hardware platform.
软件开发的历史是抽象层次不断提高的历史,我们的工业以前是通过将电路焊接在一起以形成硬件组成的程序,这样来进行系统的搭建。机器码使得我们可以通过操作开关来输入每条指令,数据保持在×××××。。。,后来,汇编程序通过为每种硬件平台定义相应助记符的形式,帮我们把这种繁琐的0/1操作中解放出来。
At some point, programming languages, such as FORTRAN, were born and "formula translation" became a reality. Standards for COBOL and C enabled portability among hardware platforms, and the profession developed techniques for structuring programs so that they were easier to write, understand, and maintain. We now have languages like Smalltalk, C++, Eiffel, and Java, each with the notion of object-orientation, an approach for structuring data and behavior together into classes and objects.
到了后来,编程语言诸如FORTRAN的出现,使得“公式翻译”成为现实,COBOL和C标准使得不同硬件平台之间的移植成为可能,后来发展出了结构化的程序设计方式,使得编程语言更容易编写、理解和维护。我们现在拥有像smalltalk、C++、Eiffel和Java,它们运用了面向对象技术,一种把数据和行为封装到类和对象的方法。
As we moved from one language to another, generally we increased the level of abstraction at which the developer operates, which required the developer to learn a new, higher-level language that could then be mapped into lower-level ones, from C++ to C to assembly code to machine code and the hardware. At first, each higher layer of abstraction was introduced only as a concept. The first assembly languages were no doubt invented without the benefit of an (automated) assembler to turn mnemonics into bits, and developers were grouping functions together with the data they encapsulated long before there was any automatic enforcement of the concept. Similarly, the concepts of structured programming were taught before there were structured programming languages in widespread industrial use (for instance, Pascal).
当我们从一种语言发展到另一种语言的时候,通常我们提高了开发者进行开发所处的抽象层次,这需要开发者学习新的、更高层次的能够映射到低层次的语言,如C++到C到汇编代码到机器码和硬件。最初,每一个更高层次的抽象只是作为一个概念被引入。最初的汇编语言被发明的时候,作为把助记符转换到字节码的汇编器并没有体系出什么明显的又是。。。。,类似的,结构化程序设计的概念也显得很不为人接受直到结构化编程语言在工业界广为使用。
Over time, however, the new layers of abstraction became formalized, and tools such as assemblers, preprocessors, and compilers were constructed to support the concepts. This had the effect of hiding the details of the lower layers so that only a few experts (compiler writers, for example) needed to concern themselves with the details of how those layers work. In turn, this raises concerns about the loss of control induced by, for example, eliminating the GOTO statement or writing in a high-level language at a distance from the "real machine." Indeed, sometimes the next level of abstraction has been too big a reach for the profession as a whole, only of interest to academics and purists, and the concepts did not take a large enough mindshare to survive. (ALGOL-68 springs to mind. So does Eiffel, but it has too many living supporters to be a safe choice of example.)
随着时间的过去,然而,新的抽象层次也开始正式形成,相应的工具如汇编器、预处理器和编译器开始出现以支持这些概念。它们把低抽象层次的细节隐藏,使得只有少数的专家(如编译器的编写者)需要关心这些细节如何工作。。。。。
As the profession has raised the level of abstraction at which developers work, we have developed tools to map from one layer to the next automatically. Developers now write in a high-level language that can be mapped to a lower-level language automatically, instead of writing in the lower-level language that can be mapped to assembly language, just as our predecessors wrote in assembly language and had that translated automatically into machine language.
随着开发者开发的抽象层次的提高,我们开发出从一个层次自动映射到另一个层次的工具。开发者现在只需编写高层次的编程语言,之后的转换将是自动进行的。
Clearly, this forms a pattern: We formalize our knowledge of an application in as high a level a language as we can. Over time, we learn how to use this language and apply a set of conventions for its use. These conventions become formalized and a higher-level language is born that is mapped automatically into the lower-level language. In turn, this next-higher-level language is perceived as low level, and we develop a set of conventions for its use. These newer conventions are then formalized and mapped into the next level down, and so forth.
显然,这形成了一种模式:我们不断地提高抽象的层次的概念,随着时间的过去,我们学会了如何使用这种语言以及应用一系列的使用约束。这些约束变成正式后一种新的语言诞生了,而这种下一代的语言是从低层次被感知的,当我们定义一系列的使用约束之后,这些新的约束又被正式化,来推动下一阶段的发展。不断地循环。
The next level of abstraction is the move, shown in Figure 1-1, to model-based development, in which we build software-platform-independent models.
下一阶段的抽象层次在发展,如图所示。它是基于模型的开发,在这里我们建立的是和软件平台无关的模型。
Software-platform independence is analogous to hardware-platform independence. A hardware-platform-independent language, such as C or Java, enables the writing of a specification that can execute on a variety of hardware platforms with no change. Similarly, a software-platform-independent language enables the writing of a specification that can execute on a variety of software platforms, or software architecture designs, with no change. So, a software-platform-independent specification could be mapped to a multiprocessor/multitasking CORBA environment, or a client-server relational database environment, with no change to the model.
软件平台无关是和硬件平台无关类似的概念。一个硬件平台无关的语言,如C或者Java,可以使得一个规范的编写能够在不同的硬件平台上运行而不需要更改。类似地,一个软件平台无关的语言可以使得一个规范的编写可以在不同的软件平台上运行,或者在不同的软件架构中运行,而不需要更改。因此,一个软件平台无关的规范可以映射到多处理器/多任务CORBA环境,或者一个C-S关系数据库环境,而不需要更改模型。
In general, the organization of the data and processing implied by a conceptual model may not be the same as the organization of the data and processing in implementation. If we consider two concepts, those of "customer" and "account," modeling them as classes using the UML suggests that the software solution should be expressed in terms of software classes named Customer and Account. However, there are many possible software designs that can meet these requirements, many of which are not even object-oriented. Between concept and implementation, an attribute may become a reference; a class may be divided into sets of object instances according to some sorting criteria; classes may be merged or split; statecharts may be flattened, merged, or separated; and so on. A modeling language that enables such mappings is software-platform independent.
总的而言,由概念模型所驱动的数据的组成和处理也许和实际的数据组成和处理不完全相同。如果我们考虑两个概念,比如“customer”和“Account”,将他们建模程UML的类图以期望能够被用。