On 9/26/07, Cassidy, Alan <CassidyA@xxxxxxxxxx> wrote:
Aaron,
Remember Joel Cochran? RPG-Next? He of http://www.rpgnext.com/?
I think he still might lurk around here somewhere, and his web site is
still good, just to let him know he's welcome to pipe in if he's there
(we won't throw stones at you, Joel)
He has already expounded on the issues involved in encapsulating I/O in
this article:
http://www.itjungle.com/fhg/fhg072104-story01.html
I -think- he even has downloadable code ready-to-go for creating a
service program for any database file.
Yes, I'm still here in *lurk* mode.
The File Encapsulation experiment still lives at
http://www.rpgbeans.com -
at the time I was really trying to push the boundaries of ILE design, highly
influenced by (as Aaron suggests) what I was learning in OO languages. And
I did write a couple of articles about it. The justification for it is the
same in RPG as it is in Java or other OO languages: by moving the IO to a
service program, you have control over how the data is manipulated. In
other words, you are protecting your database from misuse. Triggers could
do the same thing, but they give me the willies. The idea was to have a
single SRVPGM resource that would manage access to a particular file. It
could also provide ready-made procedures, such as string formatting,
calculations, etc. You can use this approach to access your old cryptic
field names with longer more meaningful names.
The truth is that while the concept is sound, it takes an enormous amount of
discipline in order to secure the desired results. The ease of database
access is sometimes too tempting (I'll just update the file directly this
ONE time...). Also, working with Collections of records would need to be
added: this would best be handled with User Spaces but could also be done
with MODS.
Anyway, the code generation tools are still out there if anyone is
interested. It is free and open source, use it as desired but also at your
own risk. I am not currently in a position to maintain or upgrade the code.
As an Amazon Associate we earn from qualifying purchases.