DEV Community

Greg Jarmiolowski
Greg Jarmiolowski

Posted on • Updated on

Prioritize declarative

When logic is less discoverable it is easier to overlook and become a source of defects.

One beautiful thing about APEX is that everything resides in this relational container. Used correctly everything can be found easily. You can determine all your dependencies and make changes without the risk of not knowing what you missed.

When you look at the builder and the various ways it can be laid out, consider that you can create your own special view of that same data .. as long as you treat it as data. When I open a new application I love that I can easily reason about the easy parts, like how does a page render, what does it render?

When several Conditions apply to the execution of some code it may be better to create multiple Processes, one for each Condition, than to put the Conditions inside the Process code itself. It can be tempting to put them all in one Process so you have them all in one place. But APEX is “one place” too and you can organize your code inside multiple Processes and achieve something that reads like a boxes and arrows diagram. Add in some verbose naming and the reader can understand what these processes do without digging into code.

Instead of declaring local variables inside an anonymous PL/SQL block, create page items and compute them. It might seem like overkill to do this but then when you need to debug this you get session state and logging for free.

Top comments (0)