× 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: Can RPGLE simulate OO programming?
  • From: "Eric N. Wilson" <doulos1@xxxxxxxx>
  • Date: Fri, 18 Feb 2000 11:51:35 -0800

Scott

(tongue thoroughly in cheek)

Yes I understand what an object is in OO but by having the service program
as the "OBJECT" and the first parameter as the "Method"  (Which is really
what occurs behind the scenes in OO languages). Just look at the code that
is emitted from the CFRONT compiler ( AT&T C++ -> C ) and you will see
similar ugliness :-)

Having the service program manage storage and what have you for a list of
"objects" . You could simulate Polymorphism and Encapsulation which are the
other two tenants of OO. Yes this is not ideal but I just thought I would
throw to see how well it stuck :-)

You know two out of three aint bad :-)

Oh and this could be VERY UGLY :-) Especially if you had the Service
Program/Object do methods to set/get every field. But you could have an
array of objects in memory and do who knows what to then and treat them just
like objects...

The question being can RPGLE simulate OO programming, and my answer is "yes
in a limited fashion and with a lot of work". Is it worth it? Depends on the
person looking at the problem. Shoot we have all the tools now to actually
be able to write a compiler using just ILE-RPG (specifically pointers and
the ability to do recursion). This is yet another project that sounds too
painful to implement :-) But it could be done.

That's all I was trying to get across.
Eric

______________________________________________
Eric N. Wilson
President
Doulos Software & Computer Services
2913 N Alder St.
Tacoma WA 98407


----- Original Message -----
From: "Scott Klement" <infosys@klements.com>
To: <RPG400-L@midrange.com>
Sent: Friday, February 18, 2000 10:28 AM
Subject: Re: Can RPGLE simulate OO programming?


> That wouldn't solve the problem.  an "object" in an OO language can
> have methods (i.e. procedures) that you can call.   You can declare
> an array of objects, or different objects of the same type, and
> each one has its own copy of the routines that you can call.
>
> Just allocating memory for a data structure doesn't really solve
> this problem.
>
> Furthermore, I'm wondering what your design accomplishes?  You call a
> service program with an externally defined data structure, and then
> it does the operation that you would, otherwise, do directly.
>
> What does this save you, in terms of maintenace?   Or coding?
> All it does is add overhead.
>
>
> "Eric N. Wilson" <doulos1@home.com> wrote:
> > I was just thinking... Perhaps you could have a service program per
> >  file and
> > as the first parm you would pass the operation and as the second par
> >  a
> > pointer to a DS and optionally a third parameter also a parm to a DS
> >  The DS
> > could be allocated dynamically by either the service program or the
> > application but then you would be able to have arrays of objects and
> >  perform
> > the action upon it via the parameter interface.
> +---
> | 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
> +---
>

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