My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
WhatisCOM  
Explains Common Object Model (COM)
Updated Jun 3, 2009 by mleon...@civeng.adelaide.edu.au

COM stands for Component Object Model. It is a language-neutral mechanism for programming so that the features of an application written with a COM interface can be accessed from other programs. COM offers a standardised object-oriented mechanism for programming so that the contents and features of an object (read: program) can be accessed without needing to know the internals of that object (program). It is very powerful and is the basis of many of the dynamic activities of programs today. In this case, R is termed a 'server' and your Fortran program is the 'client' that is making requests to functions in the server. Each server has a unique ID that is stored in the registry when that program is installed. The server is then invoked by using built-in initialisation functions and by referencing the ID specific to that server. You may also see COM referred to as DCOM, where the 'D' stands for distributed. This simply means that you can have the R server program stored on a separate machine and communicate with it over a network. You can read more here.

COM is a mechanism for providing inter-operability between programs/programming languages and is the successor to the dynamic-link-library (DLL) system. By using a standard interface and employing object-oriented concepts (namely encapsulation), COM is a popular choice for modular programming. Currently, Microsoft are backing another mechanism as a successor to COM. It is known as .NET (dot-NET), which uses the Java concept of compiling to an intermediate language and then using a run-time environment to interpret the language as a script. It is worthwhile to note the growing support for .NET, but due to the popularity of COM, it is unlikely to mean that COM stops being supported in the near future. Even if changes do occur, because R and the R-server are both freeware there is nothing to stop you continuing to use RFortran well into the future (providing that you still have a copy of the Compaq or the Intel compiler).

COM is a Microsoft technology, so for this reason you are restricted to using it on Windows platforms only. Even though R exists for Linux and other platforms, you will not be able to use RFortran on these platforms as the COM interface is not present. It seems that COM was developed with C++ and Visual Basic programmers in mind and not really Fortran. Therefore, the standardised mechanisms for passing data between COM server and COM clients are not too friendly to Fortran. For example, Fortran tends to handle strings and arrays a little differently to other languages. What this means is that there are some extra hoops that need to be jumped through in order to link with COM servers using Fortran. For this reason, the company that supports your favourite compiler, in the wisdom of economy, may not have chosen to implement these features. Compaq Visual Fortran, now superseded by Intel Visual Fortran are the only two compilers that have been tested with RFortran. It is not simply a matter of compiling the same code with a different compiler, as the compiler needs to provide some back-end libraries in order to make it work. (If you are aware of other Fortran compilers that support COM, please let us know.)


Sign in to add a comment
Powered by Google Project Hosting