What are the benefits of using a package? Describe two parts of a package and their contents.

What will be an ideal response?


The objects in a package can be declared as public objects, which can be referenced from
outside, or private objects, which are known only to the package. You can restrict access
to a package to its specification only and hide the actual programming aspect of it. A
package follows some rules of object-oriented programming, and it gives programmers
some object-oriented capabilities. A package compiles successfully even without a body,
if the specification compiles. When an object in the package is referenced for the first
time, the entire package is loaded into memory. All package elements are available from
that point on because the entire package stays in memory. This one-time loading
improves performance. It is very useful when functions and procedures in it are accessed
frequently. The package also follows top-down design.
A package provides an extra layer to a module. A module has a header and a body,
whereas a package has specification and a body. A module’s header specifies the name
and the parameters, which tell us how to call that module. Similarly, the package
specification tells us how to call different modules within a package.
A package specification does not contain any code, but it contains information about
elements of the package. It contains definitions of functions and procedures, declarations
of global or public variables, and anything else that can be declared in a PL/SQL block’s
declaration section. The objects in the specification section of a package are called public
objects. 
A package body contains actual programming code for the modules described in the
specification section. It also contains code for the modules not described in the
specification section. The module code in the body without its description in the
specification is called a private or hidden module, and it is not visible outside the body of
the package.

Computer Science & Information Technology

You might also like to view...

Write a procedure PathLookup(Pathname, Dir) ? UFID that implements Lookup for UNIX-like pathnames based on our model directory service.

What will be an ideal response?

Computer Science & Information Technology

You can also change a list that you already typed to a bulleted or numbered list by selecting all the items in the list, and then clicking either the Bullets or Numbering button in the ____ group.

A. List B. Paragraph C. Bullets and Numbering D. Font

Computer Science & Information Technology

? Critical Thinking Questions Case 4-2 ? Jerry has inherited an Excel sheet that lists all of the system requirements for his team's new project. But unfortunately, his predecessor did not label the requirements with categories-or in some cases failed to categorize them correctly. He needs to take care of this so the requirements can be sorted correctly. ?Jerry has found one system requirement that he thinks could fit into a couple of different categories. The requirement is as follows: An employee record must be added, changed, or deleted only by a member of the human resources department. What is the best categorization of this requirement?

A. ?Performance B. ?Control C. ?Process D. ?Input

Computer Science & Information Technology

An outside contractor is hired to perform a business impact analysis of a simulated disaster. The contractor asks stakeholders what they think a hurricane would do to the business. This is an inadequate method because:

A. the question is related to disaster recovery, not impact analysis B. the question is subjective and does not represent a complete business impact analysis C. it is impossible to perform an impact of anything simulated D. hurricanes vary in intensity, so the business impact is always unknown

Computer Science & Information Technology