Next: 4.3 Terminology
Up: 4. Implementing COM objects
Previous: 4.1 Introduction
Contents
Next: 4.3 Terminology Up: 4. Implementing COM objects Previous: 4.1 Introduction Contents Fabio Mascarenhas de Queiroz 2005-01-07
4.2 Is it really useful?
Some might argue that it would be better to implement COM object in languages like C++ or Visual Basic©. That's true in many situations, and false in several others. First, dealing with COM is not easy and LuaCOM hides most its complexities; besides that, there is another compelling reason for using LuaCOM at least in some situations: the semantics of Lua tables and the way LuaCOM is implemented allows one to do some neat things:
- to expose as a COM object any object that can be accessed via
Lua through a table. These might be CORBA objects, C++ objects, C
structures, Lua code etc. Using this feature, a legacy application or
library may be ``upgraded'' to COM world with little extra work;
- to use COM objects anywhere a Lua table is expected. For
example, a COM object might be ``exported'' as a CORBA object,
accessible through a network;
- to add and to redefine methods of an instance of a COM
object. This might be very useful in the preceding situations: an
object of interest might be incremented and them exported to another
client.
Of course all this flexibility comes at some cost, primarily performance. Anyway, depending on the application, the performance drawback might be negligible.
LuaCOM does not solve all problems: there is still the need of a type library, which must be build using third party tools.
Next: 4.3 Terminology Up: 4. Implementing COM objects Previous: 4.1 Introduction Contents Fabio Mascarenhas de Queiroz 2005-01-07