× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Converting to upper case
  • From: Jim Langston <jimlangston@xxxxxxxxxxxxxxxx>
  • Date: Wed, 20 Dec 2000 08:45:11 -0800
  • Organization: Pacer International

Dan,

The whole advantage is you don't have to test all your programs.

Each function has input and output, naturally.  When you design your
functions you have to define what type of data you are going to receive,
and when you are going to send back.  As long as those parameters don't
change, it makes absolutely no difference how you come to those results.

If I have my program ConvertToUpper(WhatToConvert) and it accepts a string
and returns a string, does it matter how I convert it, as long as the two
parameters don't change.

In one application I had written I had not done this, and when I found better
ways to do things I went through every one of my 250 applications and made
changes and had to test everything.  I got tired of it, and decided to use
this technique.  I built a library with calls that encapsulated all my file
IO, from file opens to closes, to reads, to writes.  Then I went through my
programs and changed all file IO to call these procedures.  The way I had 
done it was that at this point you could do it either way, by calling the
procedures or doing the file I/O directly.  Eventually not a single program
did any file IO whatsoever.

Then I started changing the way I did file IO and came up with some pretty
nifty schemes.  Everything worked like a champ.  At one point I found an
even better way to do some stuff, and totally changed the way I did file IO.
I changed 3 function libraries, recompiled, tested a few programs and put it
into production.  Everything worked like a charm without a single bug.  I can
guarantee you that if I had tried this without the centralized calls I would
of had bugs coming out of my ears.

If IBM changes the way they do %Subst but leave the end results exactly the
same, do you go through all your programs and re-test everything?

Also, remember this, we are not just encapsulating XLATE so all programs call
it.  We are using XLATE to do something, to convert a string from lower case
to upper case. XLATE can do much much more.

Regards,

Jim Langston

D.BALE@handleman.com wrote:
> 
> In theory (gotta have a copout!), I concur with your laudable goal of
> centralization & encapsulation.
> 
> I see at least one risk, however.  You mention the ability to enhance your
> functions.  Say you've got a particular function used in hundreds of
> applications.  You make an enhancement to it.  Are you going to test those
> hundreds of applications that use it?  If not, why not?  How can you know that
> what you considered an enhancement does not actually introduce an error into
> one program that has a "special case"?
> 
> Also, taken to the extreme, you *could* externalize all of the opcodes (except
> EVAL) into procedures.  Have you done that?  Well, jeez, that sounds rather
> snippy, doesn't it? (still only on my first coff of cuppee this morning,
> sorry) <g>  OK, rephrase:  Are there any other opcodes that you've
> externalized?
> 
> Dan Bale
> IT - AS/400
> Handleman Company
> 248-362-4400  Ext. 4952
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.