Advantages of packages in oracle pl sql
It is more used in software engineering in oracle sql pl/sql development career. It provides the important features like reliablity,maintainability,resusablity of codes and used in the large and complex systems by using the group of team efforts. It will group the related procedure,function,variable and making the code which is easier to maintain and manage. Codes are reused in the multiple applications which reside in it reducing duplication and maintenance problems which occur in the future.
It is loaded into the memory as per the session. It avoids repetitive use and improve the speed of execution of the source codes. It supports the overloading with the multiple procedures or functions with the same name exist with different and various parameters. It acts like the code management in inventory management in which the several sub-programs have come under the single package for add and modify item. It is used instead of the standalone subprograms.
Modularity:
It helps the programmer to encapsulate all the logical related items, variables,constants,cursors,exceptions,types and sub-programs in the named PLSQL module. Each package is very easy to understand. Its interfaces are very simple, clear and easy to understand for the group of programmers which are working on the specific project. It helps in the application development.
Build in easier application design:
Whenever you have to design the application, you need to know about the interface which is in the package specification. You can do coding work and compile the source codes without package specification without its body. Stored sub-program which is referenced to the package can be compiled as per business requirements. You don't need to define the package body fully unless the complete application is ready.
Information Hiding:
With the help of packages, we can specify the types,items,sub-programs are made public and private. Public which refers to the visible and accessible. Private which refers to the hidden and inaccessible. If the package contains the four programs, out of which three are made public and out of which one is made private. It hides the implementation of the private subprogram. If the implementation gets changed, then only the package will be impacted not the entire running application. It simplifies the maintenance and enhancement problem. Hiding the implementation details from the end users can protect the integrity of the package.
Add functionality:
Package public variables and cursors are responsible for the duration of the session. Added functionality are shared by all the subprograms which are executing in the environment. It maintains the data which are using in the transaction without storing in the database.
Better(best) performance:
Whenever the package sub-program is called for the first time, the whole package is loaded into the memory. Related sub-program will not require input or output disk, if it is called later. It stops the cascading of dependencies and try to avoid or stop the unwanted or unrequired compilation. If you change the body of the package function, oracle will not recompile all the sub-program which are calling the function. Sub-programs which depend on the parameters and return value which are declared in the package specification. They can be recompiled if the specification get changes.
Comments
Post a Comment