wiki:Eiffel FAQ

Version 2 (modified by KOBAYASHI, Shinji, 12 years ago) (diff)

--

openEHR Eiffelに関するよくある質問

openEHR Eiffel FAQ


openEHRとEiffelはどういう関係ですか?

What is it with openEHR and Eiffel?

openEHRはEiffel言語を使っていることを知っている人は多いけれども,どうしてEiffelでopenEHRが記述される必要があるのか,EiffelがopenEHRでどのような特別な役割をはたしているのか不思議に思っているでしょう。Eiffelは公開の場で定義された言語であり,Eiffelに対する国際的な非営利コンソーシアム(国際的なユーザーグループ)とECMAが公式な標準化プロセスを担っています。数多くの商用実装があり(ISE, Object Tools)があり,公式なオープンソースコンパイラ("SmartEiffel?")と数多くのライブラリがあります。

Many people have noticed that openEHR uses the Eiffel language, and wonder whether openEHR needs to be written in Eiffel, or whether Eiffel is in some way special in openEHR. By way of background, Eiffel is an openly defined language, has its own Non-profit International Consortium for Eiffel (an international user group) and ECMA formal standardisation process. It has a number of commercial implementations (ISE, Object Tools), an official open source compiler ("SmartEiffel?") and large numbers of libraries.

EiffelはopenEHRでは最初のCASEツールとして使われています。どうしてプログラミング言語をCASEツールとして使うのか,どのように使っているのか,少し奇妙に感じるかもしれません。事実として,Eiffelは他のプログラミング言語とは少し違うところがあります。まず,型付けが完全になされていることと完全なオブジェクト指向言語です。C++以外でUMLのすべてのセマンティクス(特に「総称」(genericity)クラスや多重継承,ポリモルフィズム,selective export)を実装できる唯一の生産的言語でもあります。しかしながら,C++とはことなりメモリ構造のような実装の詳細には拘束されません。さらに,利用できる他の生産的言語とは異なり,OCL(OMG Object Constraint Language)と同等の実装がなされています。「同等」というのは,OCLが存在する15年も前からEiffelが実現していたことですから。openEHRに関係のあるOCLの重要な特徴は「アサーション(言明)」とよばれるもので,

Eiffel is used in openEHR as its primary CASE tool. This may sound a little strange - why use a programming language as a CASE tool; how? In truth, Eiffel is a little bit different from other programming languages. Firstly, it is a fully formal, fully object-oriented language, the only production language apart from C++ which implements all the semantics of UML (in particular, genericity (i.e. 'template' classes), multiple inheritance, polymorphism, selective export). However, unlike C++, it has no connection with implementation details, such as memory structures. In addition, unlike any other production language available, it implements the equivalent of OCL, the OMG Object Constraint Language. "Equivalent" because Eiffel did this 15 years ago, long before OCL came into existence. The key features of OCL which are relevant to openEHR are called "assertions", which include function pre-conditions, post-conditions, and class assertions. These statements allow us to define the correctness conditions of a class model.

These features allow it to be used as a language for expressing formal class models, of the kind used in the specifications written by openEHR, and to completely validate them, including assertions. Does openEHR have to be implemented in Eiffel?

No, it doesn't. The choice of language is completely up to the developer organisation, and usually relates more strongly to available human resources and so on. There are parts of openEHR being developed in Java, C#.net, Oracle, VB.net, and in the future, it is expected that Python will be used, among others.

However, Eiffel does happen to be an excellent choice for implementation, for two reasons:

  • the need for correctness when processing health information (e.g. consider the consequences of a software bug causing the coded term for "kidney, left" to be changed to "kidney, right"). Only Eiffel implements assertions
  • the ability to bind properly to the two "big" languages around today, namely C# and Java. It is worth considering that we are now in an IT environment somewhat like the CORBA/COM situation of a decade ago. Many companies and other organisations promised that the two would talk together; they never did, properly. Similarly, there are political reasons why companies (particularly Sun and Microsoft) are unlikely to make it easy for developers to jump to the other side, or integrate software written in the two languages properly. Eiffel does offer one solution to this problem. Tools have already been built by ISE which compile Eiffel code to native .Net bytecode, meaning that Eiffel components can be deployed seamlessly with components written in other .Net languages. Eiffel has also be wrapped for Java in production software in health, and can be reliably deployed in Java environments. The upshot of this is that a single code base for an important component could be written in Eiffel and deployed on all platforms, not just in one or other of the .Net or Java worlds.

The types of implementation which we foresee in the future are multi-language component-based systems, not single language systems. For example, a reference openEHR kernel implemented in Eiffel could be deployed in both .Net and Java worlds via interfacing solutions which already exist; in each environment they would be used in the appropriate application server environment, e.g. J2EE or similar. Other systems are likely to use a diversity of languages for presentation and back-end databases as well.

The bottom line is: implement in whatever technology you choose, you will still most likely to be able to take advantage of any openEHR components that happen to be in Eiffel. How can I look at the openEHR Reference Model in Eiffel?

You could download a copy of Eiffel and browse using the IDE. But you'd probably complain about having to do the download, and learn a new IDE! So there is a much easier way. The entire openEHR specifications are available in a completely hyperlinked HTML tree, on the openEHR website. How can I interface my Java or C# software to Eiffel components?

First of all, you might not care about this, since there are a growing number of native Java and C# implementations of openEHR - and there is absolutely nothing stopping you writing all your software in your favourite language. Some reference components written in Eiffel already have a C# wrapper, and will soon have a Java wrapper, such as the ADL reference parser.

For those who do care...C# is easy. ISE, one of the Eiffel vendors has produced a solid set of .net tools which enable any Eiffel piece of software to be made available as a .net DLL, directly usable by VB.net, C#.net, and any other .net language. This has been tested in the ADL tools with both C# and VB.net graphical front-ends, including the ability to dispatch C# -programmed functions in Eiffel.

Interfacing to Java is somewhat more work. Eiffel to Java interfacing has already been done in production health software by various companies, including ENEA-data in Sweden. There are well-known methods for doing it, but it requires a little work. A java wrapping is in development for the openEHR ADL reference parser. Is there an open source version of Eiffel?

Yes, it's called SmartEiffel?, and as far as we know, it implements everything in the Eiffel specification, plus well-known extensions such as "agents".

Other resources include:

  • newsgroup
  • numerous books; try searching Amazon.com
  • numerous libraries (see e.g. Google Eiffel directory)

日本語サイト: