Promoting SoC Through Application Layering

Creating a layered design in an application is a fundamental element of modern software architecture. The goal is to promote the Separation of Concerns (SoC) design principle. Separation of Concerns The ideas behind SoC date back to Dijkstra's 1974 paper "On the role of scientific thought" . In computer science, separation of concerns (sometimes abbreviated as SoC) is a design principle for separating a computer program into distinct sections. Each section addresses a separate concern, a set of information that affects the code of a computer program. A concern can be as general as "the details of the hardware for an application", or as specific as "the name of which class to instantiate". A program that embodies SoC well is called a modular program. Modularity, and hence separation of concerns, is achieved by encapsulating information inside a section of code that has a well-defined interface. - Wikipedia SoC is a broad design principal th...

Oracle Packages Search

When working with any complex Oracle implementation, it can be useful to search across multiple packages / stored procedures for a string. Fortunately, the content of custom packages is stored in USER_SOURCE.

This trick has been useful numerous times over the years and requires no elevated privileges; however, you'll only get results for packages that your current login has permission to access.

Use the following SQL statement to search all custom packages / stored procedures for a string value.

	SELECT *
FROM USER_SOURCE
WHERE LOWER(text) LIKE LOWER('%INSERT_SEARCH_TEXT%');

Simply replace INSERT_SEARCH_TEXT with the text you are searching for. Make sure to keep the Oracle wild card characters (%) and remember that the search string must escape any special characters using Oracle's escape syntax (details here).