Subject | Re: [Firebird-Architect] Packages |
---|---|
Author | Vlad Khorsun |
Post date | 2008-07-11T13:31:56Z |
>>> Dumb example:It's ok for me
>>>
>>> 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 ?
>>
> For packages with lot of external items, it will be a problem. With
> external info in the header, there is no need to a body.
>
> But we can allow simple declaration in the header with redeclaration
> with details in the body.
>>> Security should act on the entire package and not in individual items,We may do it for usual PSQL objects too.
>>> i.e. we should have GRANT EXECUTE ON PACKAGE <name> ...
>>>
>>
>> Not sure about it, but lets think more on it...
>>
> It's very useful having DEFINER rights privileges. In Oracle, by default
> packages uses definer rights.
Anyway, for relations, for example, we have separate privileges (SELECT, INSERT,
UPDATE, DELETE). Imagine package which implements procedures to deal with some
kind of complex objects. It can have procedures for read-only and for read-write work
with this objects. Why should we use the same privileges for all of this procedures ?
I.e. we can't separate users which allowed to view objects from users which allowed
to edit objects.
...
>> It will not work without changes in remote protocol and API. Remember USHORT'sWe can change protocol of course, but we need API change also. Its about
>> used for statement text length
> For statement length, we could do it using new protocol version like
> changes done recently, no?
isc_dsql_execute_immediate and isc_dsql_prepare
>> and BLR length ?isc_ddl also public API ;) Since we have DSQL inside the engine its not a problem
> It's not a problem. BLR will be stored separated in rdb$procedures.
but if we going to add, say isc_dsql_prepare2, why not add isc_ddl2 ? :)
>> Ability to manage individual items in package is good thing and worth implementing,Are we really need to store whole package body (header) sorce as one unit ? It can be
>> i believe.
>>
> The problem is that I want to make it as a single entity for upper
> levels. How changes to procedure body will reflect on package body
> source, for example?
easy generated from system tables. Or we can store only VAR part (in Pascal terms) ...
BTW, when do we need whole package header\body ? For documentation purposes ?
Another usage ? :) It is may be handy to create package by one statement, agreed. But
later, when we need to alter it - why parse and recompile whole (huge) package ?
> And dependencies (see below)?Ok, understand.
>
>> Explain, please, more - how do you going to deal with dependencies ?
> There will be new object types for RDB$DEPENDENCIES. PACKAGE HEADER and
> PACKAGE BODY. Dependent objects of procedure bodies will be in
> RDB$DEPENDENCIES using PACKAGE BODY type. Dependent objects (TYPE OF
> [COLUMN]) of parameters of public items will be as PACKAGE HEADER.
>
> They will be stored using the package name, and not name of individual
> items.
Regards,
Vlad