16.8.2.5.1 Organizing Application Logic in a Package

Encapsulate business logic in a PL/SQL package so you can maintain it and change its implementation without affecting callers.

The EBA_DEMO_WOODSHR_FILE package contains several procedures and functions the page uses:

Table 16-3 EBA_DEMO_WOODSHR_FILE Program Units

Name Purpose
UPLOADED_BREAKROOM_PHOTOS Returns true if user has any pending uploaded photos.
WIPE_UPLOADED_BREAKROOM_PHOTOS Clears out UPLOADED_PHOTOS collection
PREP_UPLOADED_BREAKROOM_PHOTOS Adds unique uploaded file name for uploaded photos to a collection in preparation for collecting a corresponding title for each one.
DOWNLOAD_UPLOADED_TEMPORARY_PHOTO Serves temporary uploaded image as inline data for previewing in the grid.
SEQ_ID_FOR_UNIQUE_FILENAME Looks up the collection sequence id for the row having the unique file name value passed in.
SAVE_UPLOADED_BREAKROOM_PHOTOS Stores uploaded images and titles in break room photos table.

The code for these package procedures and functions appears in the following sections where each gets used.