模型驱动的体系结构(1)

时间:2022-09-21 12:29:48

模型驱动的体系结构(1)

Model Driven Architecture (1)

Model Driven Architecture (MDA) is an approach to translating real-world algorithms into computer code. It focuses on representing algorithms in a modeling language, followed by a possibly automatic translation of the models into computer code. Doing justice to the definition of MDA’s innovation requires a short, potted history of computers.

Without instructions, or code, computers are just expensive heaters. One of the main problems of the Computer Age has been how to give computers instructions to translate human desire into outputs.

For about 50 years, the answer has been to code in text-based languages, all of which try to aid programming. The first of these text-based languages was assembly, which is more human-readable than machine code, though it still requires a formidable understanding of how registers, memories and, sometimes, pipelined instruction fetches work.

Fortran, which stands for “formula translator”and dates from the 1950s, was the next step in divorcing programmers from a required knowledge of hardware. It hides the computer architecture of registers and presents a syntax that allows humans to concentrate on creating algorithms. Fortran incidentally fortifies the notion of free-floating subroutines and functions.

Other third-generation languages have offered varieties of abstraction from computer hardware, imposing rules and providing new ways for organizing algorithms and data. Type-safe languages have taken a stab at preventing programmers from making certain mistakes. Permissive languages, which allow easy casting of pointers, have enabled programmers to do all kinds of marvelous thing――including stringing up their own coding nooses.

Different approaches to managing algorithms, such as structured programming and object-oriented programming, have been developed. Programming languages that facilitate these paradigms have been created, and libraries of code have been published.

A culture of best practices, which includes requirements analysis, peer reviews and modeling, has arisen to help create software that contains fewer errors and is more efficient, reusable and portable.

1. Model Methodology

Unified Modeling Language (UML) has been promoted by Object Management Group (OMG), a standards body that’s maintained by a consortium of interested companies. It has become the language for modeling algorithms and has been adopted by the software community at large. Originally, an algorithm was expressed in UML before it was manually translated into a text-based language, which was then automatically compiled into assembly language and machine code.

But that raised the question of whether the models themselves could be compiled into machine code, thus improving ways to think about algorithms and to produce software. Efforts to make the process simple and universal were the genesis of the paradigm shift that has led to MDA.

(To be continued)

模型驱动的体系结构(1)

模型驱动的体系结构(MDA)是一种将真实世界的算法转换成计算机代码的方法。它聚焦在用模型语言表示算法,然后用一种可能的转换将模型变成计算机代码。对MDA创新做一合适的定义需要简略地了解一下计算机的历史。

如果没有指令或代码,计算机只是昂贵的加热器。计算机时代的主要问题之一就是如何让计算机指令将人类的期望转换成输出。

五十年来,对此的答案只有一个,就是用基于文本的语言编写代码,一切努力都是设法来帮助编写程序。第一个基于文本的语言就是汇编,它只是比机器码更容易让人类阅读,它仍需要(程序员)了解难懂的寄存器、存储器、有时还有流水线指令,是如何工作的。

后来是Fortran,它是“公式翻译器”的英文缩写,可以追溯到上世纪的五十年代,它让程序员不必了解硬件(如何工作)。它将计算机的寄存器体系结构隐藏起来了,给出了语法,允许人类全神贯注于编写算法。Fortran还附带增强了自由浮动子程序和函数的概念。

其他的第三代语言提供了多种多样的计算机硬件的抽象、制定了规则以及提供了组织算法和数据的新方法。类型安全语言试图防止程序员犯某些错误。一些随意的语言(允许随意控制指针)能使程序员做各种各样令人惊讶的事情,包括把他们自己的编码也弄得一团糟。

结构化编程和面向对象编程等管理算法的不同方法被开发出来。方便这些范式的编程语言被发明,代码库也被出版。

一种包括需求分析、对等检查和建模的最佳实践的文化被提出以帮助编制更少错误、更高效、可复用和可移植的软件。

1. 模型方法论

对象管理集团(OMG)――一个由感兴趣的公司组成的财团扶持的标准化组织,大力促进统一建模语言(UML)。它已成为建立模型算法的语言,为软件界广泛采用。最初,在算法由手工翻译成基于文本的语言之前用UML表达,然后它自动编译成汇编语言和机器码。

但是,这也提出了能否由模型自身编译成机器码的问题,这样就改进了思考算法和生成软件的方法。为使这个过程简化和通用化,成为了这个范式向MDA发展的源动力。

(未完待续)

上一篇:图解3G接入网传输方式 下一篇:多项标准简化服务器