Difference between revisions of "Category:Service Procedures"
DaveLClarkI (talk | contribs) |
DaveLClarkI (talk | contribs) (→Justification) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Categories]] | [[Category:Categories]] | ||
+ | [[Category:Definitions]] | ||
[[Category:Programming]] | [[Category:Programming]] | ||
+ | __FORCETOC__ | ||
==Summary== | ==Summary== | ||
{{AN}} are the smallest (and only) executable part of a [[Service_Program|service program]]. This category contains sample service procedures. | {{AN}} are the smallest (and only) executable part of a [[Service_Program|service program]]. This category contains sample service procedures. | ||
Line 8: | Line 10: | ||
There are excellent reasons for having service procedures—such as shareability and standardization of business rules. However, some service procedures (minus their error checking) are so small that one might question creating a service procedure at all. They might feel that simply employing the stripped-down code directly within their program code is the best way to go (saving the necessity of calling a separate routine—with the additional overhead that such action would require). | There are excellent reasons for having service procedures—such as shareability and standardization of business rules. However, some service procedures (minus their error checking) are so small that one might question creating a service procedure at all. They might feel that simply employing the stripped-down code directly within their program code is the best way to go (saving the necessity of calling a separate routine—with the additional overhead that such action would require). | ||
{| class="wikitable" | {| class="wikitable" | ||
− | |+Rule of Thumb | + | |+ style="padding-left:6px;text-align:left;"|Rule of Thumb |
|- | |- | ||
|Sometimes, having a service procedure is simply a means of making code more self-documenting (i.e., easier for others to understand). | |Sometimes, having a service procedure is simply a means of making code more self-documenting (i.e., easier for others to understand). | ||
Line 24: | Line 26: | ||
endif; | endif; | ||
</pre> | </pre> | ||
− | It is the opinion of many that the second form | + | It is the opinion of many that the second form is self-documenting and is therefore more readable. Hence, the reason for some of these very small service procedures. |
+ | |||
+ | == Samples == |
Latest revision as of 16:38, 17 December 2018
Contents
Summary
Service Procedures are the smallest (and only) executable part of a service program. This category contains sample service procedures.
This article is a stub. You can help by editing it.
Justification
There are excellent reasons for having service procedures—such as shareability and standardization of business rules. However, some service procedures (minus their error checking) are so small that one might question creating a service procedure at all. They might feel that simply employing the stripped-down code directly within their program code is the best way to go (saving the necessity of calling a separate routine—with the additional overhead that such action would require).
Sometimes, having a service procedure is simply a means of making code more self-documenting (i.e., easier for others to understand). |
To wit... Which would you rather see in an RPG program—this?
if %subst(%trimr(myLongString):%len(%trimr(myLongString))-4+1:4) = 'TEMP'; // if suffixed by TEMP // do something endif;
...or, this?
if GenUtl_SuffixString(myLongString:4) = 'TEMP'; // do something endif;
It is the opinion of many that the second form is self-documenting and is therefore more readable. Hence, the reason for some of these very small service procedures.
Samples
Pages in category "Service Procedures"
The following 34 pages are in this category, out of 34 total.