The function of this procedure will be :
1. get a record from a file based on input parm
2. if no record found, prompt user via window for more input
3. using additional input, attempt to get original record
4. return to caller with either data from file or blank.
This processing is very specific to a group of programs and will have no use outside them.
Given this, does it make sense to break it up into separate modules?
Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions V5R2
IBM Certified Specialist- e(logo) server i5Series Technical Solutions Designer V5R3
IBM Certified Specialist- e(logo)server i5Series Technical Solutions Implementer V5R3
----- Original Message ----
From: Scott Klement <midrange-l@xxxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Sent: Monday, March 3, 2008 4:01:23 PM
Subject: Re: When to make a service pgm
I would strongly discourage you from putting database I/O and a display
screen in the same procedure -- or even the same module.
One of the basic ideas that's important moving forward is to have each
routine do only one thing (and do it well). Reading a database is
hardly the same thing as displaying data on the screen. What if,
somewhere down the road, you want the same database logic to be used in
a batch program? Or from a web application? or an SQL function, etc?
Keep your display logic separate from your business data. Put the
database access, along with any business rules, in one module. Put the
display logic, along with the handling of function keys loading
subfiles, and other routines related to displays in it's own module.
Here are some articles from System iNetwork that you might find
useful... you'll need a System iNetwork membership to view them. The
first one only requires a free ("Associate") membership. The others
would normally require a ProVIP membership, but right now the whole site
is available to free members... (I'm not sure when they plan to put the
locks back on?)
Jeff Young wrote:
I have a function that will perform DB I/O and possible require a
This function will accept 1 parameter and return 1 parameter. This
function will be called from a number of programs.
Should I - A. Make it a service program B. Make it a bound modue C.
Make it a stand alone program called by others as needed.