Thursday 7 March 2013

What are the advantage & disadvantage of package

A package is a group of PL/SQL types, objects, and stored procedures and functions. The specification part of a package declares the public types, variables, constants, and subprograms that are visible outside the immediate scope of the package. The body of a package defines the objects declared in the specification, as well as private objects that are not visible to applications outside the package.

Advantages:
Modular approach, Encapsulation/hiding of business logic, security, performance improvement, reusability.

Disadvantages:
More memory may be required on the Oracle database server when using Oracle PL/SQL packages as the whole package is loaded into memory as soon as any object in the package is accessed.
Updating one of the functions/procedures will invalid other objects which use different function/procedures since whole package need to be compiled.

1 comment: