Chapter 2. Best Practices for Packages
Packages are the most important construct in PL/SQL for building reusable code and plug-and-play components, and for employing object-oriented design techniques. As you become more comfortable with the language, you will find more of your time spent inside packages—and using programs from packages built by other developers. This may be a very pleasant and rewarding experience—if the packages are designed and implemented properly. If, on the other hand, you decide to build your packages in the same helter-skelter method (or lack thereof) I run into way too often, life out there in front of the monitor may get pretty miserable.
This chapter discusses some of the most important "best practices" for package construction and goes into detail on an effective coding style for packages. If you follow the ideas presented below, you have a very good chance of writing packages that are readable, maintainable, and enhanceable. It is also much more likely that other developers will find your packages usable and useful. You will find additional explanation regarding these practices, along with examples of the application of these practices, in the sections covering specific PL/Vision packages.
The following list offers a summary of the best practices for packages covered in this chapter:
Start with packages. Get out of the habit of building standalone procedures and functions. Instead, start with a package.
Use a consistent and effective coding style. ...