Encapsulating File Access in a Service Program
July 21, 2004 Joel Cochran
The code for this article is available for download.
Encapsulation is a familiar concept to object-oriented programmers but has yet to be seriously embraced by RPG programmers. The idea is to place all access for a particular set of data, in this case from a physical file, to one object. Then only one object can directly access and manipulate a database file. While this is standard fare for OO languages, it is hardly the norm for RPG. In this article I demonstrate a method that simulates encapsulation by using our trusty friend the service program.
WHY ENCAPSULATION IS COOL
… Read more