Subject Re: [Firebird-Architect] External Engines (and Plugins)
Author Vlad Khorsun
Adriano dos Santos Fernandes :
> Dmitry Yemanov escreveu:
>> Adriano dos Santos Fernandes wrote:
>>
>>> C++ libraries can throw exceptions and the plugin part (CppEngine.h)
>>> embedded on them deal with exceptions and translate to the Error object.
>>> There is no boundaries violation.
>>>
>> Maybe Vlad meant to say that a properly implemented dynamic library
>> should never throw exceptions to the caller process.

Yes. More - one library must never throw exceptions even to caller library. OS
level exceptions can be handled correctly between different libraries compiled
by different compilers but not "language" exceptions.

> This is not always true, but...

This must be always true else we in trouble.

>> As long as this rule is followed, you don't need to handle C++ and Delphi plugins
>> differently in terms of exceptions.
> CppEngine.h becomes part of user library. This header file was many
> inline implementation just for it. Libraries could (and are encouraged
> to) throw ThrowError::Exception (or use ThrowError::check) and the error
> will be converted to status vector. Others (...) exceptions are just
> caught as unrecognized. All done without cross library boundaries.

Then you mixed two layers (plugin itself and user library) in one header file.

> That file was designed to facilitate C++ development. It uses even
> multiple inheritance, but yes, the engine could be used by Delphi, as it
> public interface is fbCppEng* functions and *Factory classes.

Of course. And nothing prevents to create such helper library for Delphi-based
user libraryes.

Regards,
Vlad