save up to 40%

What are the advantages of using packages?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

What are the advantages of using packages?

Rating:

Packages provide an alternative to creating procedures and functions as stand-alone schema objects, and they offer the following advantages:

  • Modularity: Logically related programming structures can be encapsulated in a named module. Each package is easy to understand, and the interface between packages is simple, clear, and well-defined.

  • Easier Application Design: Package specification and package body can be coded and compiled separately. A package specification can be coded and compiled without its body. Then, stored subprograms that reference the package can also be compiled. A user does not need to fully define the package body until he is ready to complete the application.

  • Hiding Information: The programming constructs declared in the package specification are public (visible and accessible to applications). The programming constructs declared in the package body are private (hidden and inaccessible to applications). The package body hides the definitions of the private constructs so that only the package is affected (not the application or any calling program) if the definitions change. This enables a user to change the implementation without having to recompile calling programs. Also, hiding the implementation details from users protects the integrity of the package.

  • Added Functionality: Packaged public variables and cursors persist for the duration of a session. In this way, they can be shared by all subprograms that execute in the calling environment. They also enable a user to maintain data across transactions without having to store it in the database. Private constructs also persist for the duration of the session, but can only be accessed within the package.

  • Better Performance: When a packaged subprogram is called for the first time, the entire package is loaded into the memory. As a result, later calls to related subprograms in the package do not require any further disk I/O. Packaged subprograms also stop cascading dependencies and thereby avoid unnecessary compilations.

  • Overloading: Procedures and functions, when used within a package, can be overloaded, i.e., multiple subprograms can be created with the same name in the same package, each taking different number of parameters or different types of parameters.


Rating:



Other articles

Click here to Article home

 
uCertify.com | Our Company | Articles | Privacy | Security | Contact Us | News and Press Release | uCertify India
MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.