|
On 18/12/2004, at 7:05 AM, Larry wrote:
That's an interesting idea. I'd find it scary if it worked. Personally, I'd
rather use getter methods to retrieve variable data across module
boundaries. My reasoning is that, as RPG only really has two access
modifiers - PUBLIC (exported) and PRIVATE (not exported), you can't have
"package" or "protected" access to your own data. Thus, if you export a
variable from one of your modules you are allowing it to be modified by ANY
client program that binds to your service program.
You may want some of your
own programs access to the data, but not ANY program. The only safe way to
allow "restricted" access is to encapsulate the data through sub-procs. The
sub-proc can then perform some form of validation prior to returning the
variable data. The other beauty of encapsulation is that you can modify HOW
you generate the data internally, and return different values in different
scenarios. By laying bare your internal variables you restrict your ability
to re-design your module code.
Regards, Simon Coulter. -------------------------------------------------------------------- FlyByNight Software AS/400 Technical Specialists
http://www.flybynight.com.au/ Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ Fax: +61 3 9419 0175 \ / X ASCII Ribbon campaign against HTML E-Mail / \ --------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.
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.