On 08/09/14 01:30, Jim Starkey wrote: > Isn't COM a natural technology for plugins? Load a module, lookup the query > interface interface, then probe for known interfaces. If one is found, it > identifies both the formal interface and, by implication, the type of plugin. > > By definition, COM interfaces are immutable, so there is not question of > forward or backward compatibility. On the other hand, a COM object can > support number of interfaces, so extensions can be implemented as new > interfaces leaving older interfaces active for backwards compatibility. And > since a COM interface "just happens" to be a C++ class, COM object/plugins > are almost trivial to code. This eliminates all sorts of version numbering > issues, problems with calling methods that don't actually exist, etc. > > And, of course, it completely eliminates any need for a roll-your-own erzatz > vtable. > > COM, incidentally, was not invented by Microsoft but by Apollo computer > (which, incidentally, bootstraped Interbase) and was a adopted by the > consortium that eventually launched the Open Software Foundation (OSF-1 > anyone?). > > I don't think COM is even a candidate for a client API, but it is a great > choice for plugins. >
COM was a first candidate when making a choice. We decided not to use it for at least 3 reasons. Immutable interfaces are probably very good when need to change them happens not too often. But something makes me think that not too big experience with planning new interfaces will cause changes in them very soon. With immutable model code will get very dirty with all this checks of a type of interface in this particular plugin. Upgrading version of interface causes some pain when interface is received first time, but later we may call missing version and get 'normal' not implemented error. Next, COM means UTF16 (at least on windows). Do we want to change our favorite UTF8 to UTF16 on every call? We decided that we do not. And last issue. IUnknown alone is far not a full COM, at least automation is needed. I do not know an easy way to have automation tables on non-windows platforms. ------------------------------------------------------------------------------ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
