Advantages of Packages
Packages offer several advantages: modularity, easier application design, information hiding, added functionality, and better performance. Modularity
Packages let you encapsulate logically related types, items, and subprograms in a named PL/SQL module. Each package is easy to understand, and the interfaces between packages are simple, clear, and well defined. This aids application development. Easier Application Design
When designing an application, all you need initially is the interface information in the package specs. You can code and compile a spec without its body. Then, stored subprograms that reference the package can be compiled as well. You need not define the package bodies fully until you are ready to complete the application. Information Hiding
With packages, you can specify which types, items, and subprograms are public (visible and accessible) or private (hidden and inaccessible). For example, if a package contains four subprograms, three might be public and one private. The package hides the definition of the private subprogram so that only the package (not your application) is affected if the definition changes. This simplifies maintenance and enhancement. Also, by hiding implementation details from users, you protect the integrity of the package. Added Functionality
Packaged public variables and cursors persist for the duration of a session. So, they can be shared by all subprograms that execute in the environment. Also, they allow you to maintain data across transactions without having to store it in the database. Better Performance
When you call a packaged subprogram for the first time, the whole package is loaded into memory. So, later calls to related subprograms in the package require no disk I/O. Also, packages stop cascading dependencies and thereby avoid unnecessary recompiling. For example, if you change the definition of a packaged function, Oracle need not recompile the calling subprograms because they do not depend on the package body. 

解决方案 »

  1.   

    jlandzpa(欧高黎嘉陈) 说的够全了
    我也不多说了。
    一句话,便于管理,优化设计,便于开发。to csdnyork(yyp):要想学好ORACLE,必须学好英文。
      

  2.   

    模块性,信息隐藏,多态......
    例如你可以指定数据包中那些类型,项目,子程序是公用的,还是私有的,数据包隐藏私有子程序定义,所以更改了定义只会影响了数据包不会影响应用程序。希望对你有用。
    (要是拿金山词霸看oracle资料的话......确实挺费力)。