Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Packages vs. Procedure
>When is it necessary to use packages? For the time beeing I found only the
>advantage if I use global variables. Is that right?
Packages offer a couple more benefits:
1) They are loaded into memory in such a way that the code is shared,
but each user gets their own set of variables. Thus, if you are using
packaged procedures that refer to other procedures within the package,
there's no need to load the procedures separately.
2) They are much easier to maintain. For example, the current project
I'm working on has about 20 packages. If all these were anonymous
procedures, there would be around 250 of them, a real nightmare to
maintain.
3) Packages come about as close as you can get to object oriented
development within a RDBMS. They have encapsulation and polymorphism.
The only thing they lack is inheritance. (I guess this is the
equivalent of a Microsoft object. :-) )
Received on Thu Sep 24 1998 - 16:46:34 CDT