Multiple packages in the same file have multiple references can cause agility issues

[nz_btn text="Software Agility" link="http://casthighlight.wpengine.com/software-agility/" target="_self" animate="false" animation_type="ghost" color="black" size="small" shape="rounded" type="normal" hover_normal="fill" hover_ghost="fill" icon="icon-dashboard"][nz_btn text="Code Readability" target="_self" animate="false" animation_type="ghost" color="black" size="small" shape="rounded" type="ghost" hover_normal="fill" hover_ghost="screen" link="http://casthighlight.wpengine.com/category/product/indicators-methodology/code-insights/software-agility/Code-Readability/" icon="icon-code"]

Why you should care

A package is a schema object that groups logically related PL/SQL types, variables, and subprograms. They usually have a specification (spec) and a body. The spec is the package’s interface which declares the types, variables, constants, exceptions, cursors, and subprograms which are referenced from outside the package. Although the body tends to be unnecessary it defines queries for the cursors and code for the subprograms. Their advantages lie in Modularity, Easier application design, Information hiding, Added functionality, and better performance. Avoid several packages in the same file because it requires Oracle to recompile every stored program that references the packages. As a result, multiple packages are referenced causing agility issues and possible bug entry.

Business Impacts

Adding several packages in the same file can be seen as efficient but is actually a costly endevour that can hamper the code’s agility.[nz_btn text="Cost" target="_self" animate="false" animation_type="ghost" color="green" size="small" shape="rounded" type="normal" hover_normal="opacity" hover_ghost="fill" link="http://casthighlight.wpengine.com/category/product/indicators-methodology/cost/" icon="icon-office"]

CAST Recommendations

References

https://docs.oracle.com/cd/B19306_01/appdev.102/b14261/packages.htm[nz_btn text="Style Guide" target="_self" animate="false" animation_type="ghost" color="turquoise" size="small" shape="rounded" type="ghost" hover_normal="fill" hover_ghost="screen" link="https://github.com/Kristories/awesome-guidelines" icon="icon-book"]

How we detect

This code insights shows that several packages should be avoided in the same file.

About CAST and Highlight’s Code Insights

Over the last 25 years, CAST has leveraged unique knowledge on software quality measurement by analyzing thousands of applications and billions of lines of code. Based on this experience and community standards on programming best practices, Highlight implements hundreds of code insights across 15+ technologies to calculate health factors of a software.
[nz_btn text="See features" link="http://casthighlight.wpengine.com/outputs-analytics/" target="_self" icon="icon-stats" animate="false" animation_type="ghost" color="black" size="small" shape="rounded" type="normal" hover_normal="fill" hover_ghost="fill"][nz_btn text="How it works" link="http://casthighlight.wpengine.com/how-it-works/" target="_self" icon="icon-cog" animate="false" animation_type="ghost" color="black" size="small" shape="rounded" type="ghost" hover_normal="fill" hover_ghost="fill"]
For reference only. For the complete details please refer the original article
https://doc.casthighlight.com/alt_basex_package-avoid-several-packages-in-the-same-file/
Have more questions? Submit a request

Comments

Powered by Zendesk