This content has been marked as final. Show 13 replies
A long time ago a cluster of users from Packages at the sea went to the Oracle to query how stop their ongoing contention. Each side was trying to get the upper hand and leverage those advantages against the other side. It had to stop. They were told they might be able to function as a society they would come together at the table, and clarify their procedures and views in a routine fashion.
Heeding the words of the Oracle they linked together, and stopped their wars. The advantages of Packages, were now known as the Disadvantages of Packages, and are taught so they may never repeat.
The story is very interesting. I can't wait for the sequel.
As you can see from the humorous responses, there are no disadvantages. Your question is like asking "What are the disadvantages of a Hammer?".
Any so-called disadvantage one can think of, is in fact a rule where using the hammer is using the wrong tool for the job. Like driving in screws. Using it to stir a mug of coffee. Or as an essential tool for taking out tonsils.
Ditto for packages.
Billy, disregarding your attempts at sanity...
"What are the disadvantages of a Hammer?"A slew of loud, annoying songs?
a rule where using the hammer is using the wrong tool for the job.You must never have held a hammer. When holding a hammer, everything because so clear. Everything needs a hammer.
Like driving in screws.That would be an odd sight. Though, it would give a new definition to "going for a spin".
Using it to stir a mug of coffee.Let's see, Bob buys coffee. I want to see Bob become bereft of said coffee, without confronting him directly. Angrily, i walk over to Joe and ask him to relieve Bob of his coffee. Joe balks at me. So, i wave my hammer wildly at Joe, and Joe gets to work.
Is that called using a hammer to stir a mug of coffee?
On second thought, perhaps you should ignore this post.
1. It execute all package unit when we call subprogram of a package.That'd would be unexpected. perhaps you mean "loads all package unit"
2. Cache compiled program.Surely an advantage?
3. Difficult to maintain if package is become lengthy.As opposed to hundreds of separate procedures?
4. Specification persist without body.Allowing you global variables and type definitions. Again, a plus.
There are no inherent disadvantages. Most of things user630688 lists could just as easily feature in a list of advantages of packages. And the size of packaged code is down to proper design more than anything else.
As you can see from the humorous responses, there are no disadvantages.
One thing which has just come up in Oracle-L is from a site where it is easier to implement a piece of functionality as a view or a Crystal report rather than a stored procedure, because stored procedures are subjected to a more exhaustive (i.e. exhausting) change control process. This is not a disadvantage of packages per se, just the sort of silly thing which might lead us to favour a different solution.
Blog : http://radiofreetooting.blogspot.com/
There are disadvantages only when they are poorly designed.
One should think well what functionality has to go into a package and what should go in another package.
Package initialization is a useful thing, that you may not have with standalone func & proc.
Package cursors is yet another thing that may be useful and can't be obtained without packages.
Hiding implementation is yet another good thing which goes together with good design.
I've seen packages that show in the specification lots of things that would better be hidden, being part of the inner working of the package, that one using it need not to know. Showing out all the inner workings of the package may lead to confusion.