Subject Re: [Firebird-Architect] External Engines (and Plugins)
Author Adriano dos Santos Fernandes
Vlad Khorsun escreveu:
>>> I'd said what we have as ExternalEngine is a set of rules of how to write loadable library which this
>>> EE plugin is able to load, obtain entrypoints from library and execute its
>>> functions passing parameters and returning results. Also plugin may provide some
>>> kind of run-time support for user library. But i see no relation with language,
>>> sorry.
>>>
>>>
>> But for the database (accordingly to the standard) there are languages.
>> If you do things in other way (and don't have one to suggest) we're
>> going to complicate things.
>>
>
> Can you, please, quote standard or show paragraph numbers which is described
> LANGUAGE ?
>
"An external routine is one whose <language clause> does not specify
SQL. The <routine body> of an external routine is an <external body
reference> whose <external routine name> identifies a program written in
some standard programming language other than SQL.". Search for this
clauses.


>> Maybe you can, but is not the design goals. You will need to deal with
>> Delphi->C++ exceptions conversions, for example.
>>
>
> Why ? We have interface to report errors to the engine. Exceptions must never
> cross layers boundaries.
>
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. Delphi plugins may do the same thing.

>
>> In the end you will
>> write a Delphi plugin embedded in the library modules mixing layers.
>>
>
> No. I already have Delphi library written for original implementation so i know
> what i said here.
>
How it works with external routines preparing statements and caching
(not in ResultSet of selectable procedure) them, in SS?

For example, my C++ plugin isolates routines per attachment. See the
REPLICATE trigger. It prepares statements and just use them. They will
work on various attachments.

AFAIU, at engine level, original implementation works the same way as my
implementation, so the triggers instances will be shared across various
attachments in SS. Am I wrong? If I'm not, you need to write a lot of
code in each Delphi library you create to accomplish the behavior.

So the layers make a bit more difficult to implement "languages", and
much more easy to implement external libraries. The later will be
written by much more people than the former.

>
>>> BTW, do you have Java-plugin implemented ? If yes, does it requires Jaybird (or
>>> another Java connectivity driver) support as original plugin did ?
>>>
>>>
>> Well, since original implementors doesn't showed the Java code :-),
>>
>
> Hmm, i thought it was already integrated into Jaybird.
I don't think so.

> As for Java-plugin code (C++ bridge between EE API and Jaybird, used JNI) you may ask Evgeney
You asked him...

> or Roman
And I asked in fb-admins...

> and i'm sure they give it to you.
>
And I wait till yesterday for a reply. :-)

> Also, i know Carlos (former maintainer of .Net provider) also have .Net plugin
> written.
>
Yes, I remember he committed it. But I'm not prepared to play with .NET.

>> The world seems to like counters starting from 1. They are incorrect, we
>> know. :-) But there are many people to convince.
... more later


Adriano