× 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: Can RPGLE simulate OO programming?
  • From: "Tom Tufankjian" <Tom_Tufankjian@xxxxxxxxx>
  • Date: Thu, 17 Feb 2000 12:23:41 -0500




Lately a question has been floating through my mind:  "Can RPGLE be used in
a way simulate object oriented programing?"

For example, can a service program act as an object and it's procedures be
methods?

In OO programming you don't pass parms all the time.  You call methods to
"set" or "get" values.  That is the "public interface".  So you can add
methods to the object without affecting the public that is using it.  As
opposed to using parms where if you add a new parm you change the public
interface and have to recompile calling programs even if they don't use the
new parms.

One problem is that procedure names cannot be qualified by service program
(I don't think).  So if you used two service programs that contained the
same procedure name, rpg would be confused.

 For example, let's say you had 2 objects:  UpdCustRec and UpdItemRec.  And
they both had a method "SetStatus".  In an OO language you would code:
UpdCustRec.SetStatus('A') and UpdItemRec.SetStatus('A') .  Can you simulate
this in rpgLE?

Sorry for being so long winded.  Any comments out there?


+---
| 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 ...


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.