Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Packages vs. Procedure
On Fri, 25 Sep 1998 14:50:24 +0200, Thomas Kyte wrote
(in message <36158eed.151000477_at_192.86.155.100>):
snip
> In addition to some of the other postings about the advantages of packages
> (encapsulation, minimizing database objects - since a package has many
> procedures/functions) the MAJOR benefit of packages is that the break the
> dependency chain.
>
> packages come in 2 parts -- the specification and the body. The spec tells
snip
> When we build other objects in the database that call procedures/functions
> in some other package -- these new objects are dependent on the package SPEC
> they call -- not the body. What this means is that if the package spec
> never gets recompiled (and it shouldn't after a while, the bugs in the code
> will be in the body -- not the spec which has no code) then dependent
> objects will not get invalidated when we recompile the body.
>
> So, using a spec and body can massively cut down on the amount of implicit
> compiling that takes place -- increasing performance.
.
Thomas,
I have an application containing quite a few packages. Some packages depend on other packages and some depend on a view. There are even some views that depend on packages. (importing this alway's causes errors).
pkg_x
view_y pkg_z pkg_zz.
view_y depends on pkg_x, pkg_z depends on view_y etc. When I recompile view_y pkg_z gets invalid. After 'alter package pkg_z recompile;' pgk_zz is invalid. As far as I know it is not possible to just recompile the package body. For me the break of the dependency chain is no advantage at all and for this reason I made a little copy of v$dependency where I insert the missing links to be able to backtrack the complete dependeny list.
Do I do things wrong ? ( oracle 7.3.4.2 on aix-4.1.5 )
--
Ronald