Subject Re: [Firebird-Architect] Packages
Author Vlad Khorsun
> So far, I propose the creation of PACKAGEs. My spec. is based on Oracle
> packages, a feature widely used by its users. Initial implementation
> will have only procedures and functions. Some others features like
> package cursors and variables may be added later. Packages are also
> similar to Delphi Units (that have interface and implementation parts).

This is really great feature. I like it very much. Implemented correctly it will
attract users to Firebird, i believe. Lets make it better than Oracle ;)

...

> It makes things much more simple and elegant. There is no reason to not
> have them. :-)

Agree ;)

...
> Dumb example:
>
> SET TERM !;
>
> CREATE PACKAGE UTIL
> AS
> BEGIN
> FUNCTION SUBSTRLEN CSTRING(255) NULL, SMALLINT, SMALLINT
> RETURNS CSTRING(255) FREE_IT
> ENTRY_POINT 'IB_UDF_substrlen' MODULE_NAME 'ib_udf';

Isn't implementation details (ENTRY_POINT etc) must be in package body instead ?
...

> Security should act on the entire package and not in individual items,
> i.e. we should have GRANT EXECUTE ON PACKAGE <name> ...

Not sure about it, but lets think more on it...

> CREATE PACKAGE creates all procedures with NULL BLR. ALTER PACKAGE and
> DROP PACKAGE BODY removes all private items and set BLR of all public
> procedures to NULL. These procedures doesn't run but others could still
> reference them at compilation time.
>
> DROP PACKAGE drops the header and the body.
>
> CREATE/ALTER PACKAGE BODY should correctly implement all package
> procedures declared or will fail completely.

This is Oracle-like behavior, iirc. Imagine package with tens or hundreds objects.
Oracle recompiles it at every little change. I think we can make it better.

> Sources of individual procedures will not be stored. The package header
> and body sources will be stored in RDB$PACKAGES.

It will not work without changes in remote protocol and API. Remember USHORT's
used for statement text length and BLR length ?

Ability to manage individual items in package is good thing and worth implementing,
i believe.

Explain, please, more - how do you going to deal with dependencies ?

Regards,
Vlad