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



On Thu, Jan 8, 2015 at 9:06 AM,
<j.beckeringh@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
My code was sort of an equivalent of how you would do it in Java:

MailData maildata = new MailData();
maildata.setValue('fromAddress':'jclarkson@xxxxxxxxxxx');
(or maildata.setFromAddress('jclarkson@xxxxxxxxxxx');)
maildata.send();

The reason I do it that way is that in my scenario the caller owns the
memory. In your scenario the service program owns the memory. In practice
it probably won't make much of a difference, but I think the caller should
be the owner of the memory.

Well, of course RPG's support for class-based object-oriented
programming is weak. I personally think treating the service program
as an object (more or less like Brad suggests) is closer to the Java
model, since the data and the methods (procedures) belong with the
object, not the caller.

That being said, you bring up a good point:

And in my scenario it would be possible to
have more than one MailData 'object', in your scenario it is a singleton.

I have to admit, I don't have much experience or practice with service
programs, but if I understand correctly, it would indeed look like a
singleton to its caller. However, can multiple callers each have
their own "instance" of the service program's global data? If so,
then you can still (with further scaffolding; maybe another service
program to wrap the MailData service program?) get your multiple
MailData instances.

It's probably all moot, though. I would think the normal use case is
just to create one e-mail, send it, then create another e-mail, and
send that, etc. I think you tend not to need multiple concurrent
instances.

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.