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



Just wondering :-) If OO guys are migrating to AS/400 or AS/400 Guys are
becoming more OO guys.  In both cases it seems like AS/400 is in trouble :)

-----Original Message-----
From: rpg400-l-request@xxxxxxxxxxxx [mailto:rpg400-l-request@xxxxxxxxxxxx] 
Sent: Wednesday, May 07, 2003 9:56 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: RPG400-L Digest, Vol 2, Issue 276

Send RPG400-L mailing list submissions to
        rpg400-l@xxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.midrange.com/mailman/listinfo.cgi/rpg400-l
or, via email, send a message with subject or body 'help' to
        rpg400-l-request@xxxxxxxxxxxx

You can reach the person managing the list at
        rpg400-l-owner@xxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of RPG400-L digest..."


Today's Topics:

   1. Re: what is object oriented programming (Hans Boldt)
   2. How do I do HTTP GET, wait for response from a website? (Tom)
   3. RE: what is object oriented programming (Bartell, Aaron L. (TC))
   4. Re: How do I do HTTP GET, wait for response from a website?
   5. RE: How do I do HTTP GET, wait for response from a website?
       (Haas, Matt)
   6. RE: How do I do HTTP GET, wait for response from a website?
       (Buck Calabro)
   7. RE: what is object oriented programming (Joe Pluta)
   8. back to: improving rpg.  was: what is object oriented programming
       (Steve Richter)
   9. RE: Custom MONITOR handling (Steve Richter)


----------------------------------------------------------------------

Message: 1
Date: Wed, 07 May 2003 08:01:55 -0400
From: Hans Boldt <boldt@xxxxxxxxxx>
Subject: Re: what is object oriented programming

Steve Richter wrote:
>From the start I have been using the words "object oriented" as they apply
> to a style or programming that is applicable to RPG. I have never
understood
> what OO is, dont claim to, and after reading Hans's post above, still
dont.
> People always seem to explain it, just like Hans did, by telling you what
it
> is not, and never get around to saying what it is.

Thus my comparison to religion! It's been said that the definitive 
book on Zen never mentions Zen once. In some ways, you need to 
achieve a sort of enlightenment to understand OO, and then certain 
things you were taught earlier just don't seem to apply anymore.

I think the problem here is that (IMO) the term "Object Oriented" is 
somewhat passe, believe it or not. Has been now for perhaps the past 
decade. Or at least since the publication of "Design Patterns" by 
the so-called "Gang of Four" (Gamma, Helm, Johnson, and Vlissides) 
in 1994. That's the definitive book on the subject, and still hasn't 
been surpassed in the 9 years since publication. The introductory 
book I recommended in my last post ("Design Patterns Explained") 
refers to the GoF book extensively.

> 
> There is a style of programming that programmers can employ where data is
> encapsulated in an "object" and then procs which are "oriented" toward the
> data are called to act on the data.  An RPG programmer can employ that
style
> of programming to a degree.  I have posted examples of that.

What many people describe as "OO Programming" in ILE is often simply 
just good programming practice (as someone else here suggested). 
Some aspects of that good programming practice are more properly 
called "modular programming".

> 
> My interest in this topic is in suggesting how RPG could be improved to
> permit this style of programming to be more effectivly employed.  Procs
> could be declared as members of a data struct.  A data struct could
possibly
> be declared with an "Is a" attribute which would be the equivalent of base
> classes in C++.  Maybe there could be "property get" and "property set"
> members of a data struct.  Not knowing the secrets of ILE, even object
> access operators ( struct1 >> CustMast // write a rcd to the file ) could
be
> possible.
> 
> All of this of course will likely never happen, and if it does, it will
not
> be released until 2005, by which time most of us will be not working as
rpg
> programmers.    The "open source the compiler" suggestion, which I concede
> also is pointless, is a practical way for needed enhancements to the
> language to find there way onto the programmers desktop.

Regarding adding "OO features" to RPG, well, I certainly think about 
that myself sometimes. But the scenarios always end up more or less 
the same - an ugly mish-mash of complex features, the type of 
language Rube Goldberg would be proud of. Or features with 
unacceptably poor performance. In other words, they'd end up making 
the language more difficult to use, not easier.

If you're really brave and you want to experiment with an OO-RPG, 
you can always try the C++ approach. Early C++ compilers were 
preprocessors that converted C++ code to C code.

As I've said before, if you want to do OO programming, great! But 
there are already some superb OO languages you can choose from. For 
learning OO, I strongly recommend Python, along with the previously 
mentioned books on design patterns.

Cheers! Hans



------------------------------

Message: 2
Date: Wed, 07 May 2003 08:24:09 -0500
From: Tom <tomh@xxxxxxxxx>
Subject: How do I do HTTP GET, wait for response from a website?


We're thinking about using an online credit card processing center.  Their 
requirement is that we package up our transactions and transmit them via 
http/https, and prevent the user from being able to view sensitive data in 
the data stream.

We use Net.Data for page presentation, and I can pretty easily pass 
parameters to an RPG program.  However, I have no clue on how to write an 
RPG program to do the next steps - send the GET command, and wait for (and 
process) the appropriate responses.

Anyone?



------------------------------

Message: 3
Date: Wed, 7 May 2003 08:23:47 -0500 
From: "Bartell, Aaron L. (TC)" <ALBartell@xxxxxxxxxxxxxx>
Subject: RE: what is object oriented programming

<Joe>
...(Aaron, I suggest you get these as well, because they really show why you
need to start from the ground up when
designing OO architectures).
</Joe>

If this is from my statement of "you don't need to understand OO to make
good use of it", I didn't mean that you shouldn't learn how to build simple
base objects that can be extended upon.  I have already done some reading
from those books (mostly from Bruce's).  Note** I am not a purist OO
programmer.

Aaron Bartell


------------------------------

Message: 4
Date: Wed, 7 May 2003 09:32:27 -0400
From: MEovino@xxxxxxxxxxxxxxxxx
Subject: Re: How do I do HTTP GET, wait for response from a website?


Check out GetURI at <http://www.bvstools.com/opensource.html>.

Mike E.




 

                    Tom

                    <tomh@xxxxxxxxx>          To:     rpg400-l@xxxxxxxxxxxx

                    Sent by:                  cc:

                    rpg400-l-bounces@xx       Subject:     How do I do HTTP
GET, wait for response from a website?  
                    drange.com

 

 

                    05/07/2003 09:24 AM

                    Please respond to

                    RPG programming on

                    the AS400 / iSeries

 

 






We're thinking about using an online credit card processing center.  Their
requirement is that we package up our transactions and transmit them via
http/https, and prevent the user from being able to view sensitive data in
the data stream.

We use Net.Data for page presentation, and I can pretty easily pass
parameters to an RPG program.  However, I have no clue on how to write an
RPG program to do the next steps - send the GET command, and wait for (and
process) the appropriate responses.

Anyone?


_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo.cgi/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.






------------------------------

Message: 5
Date: Wed, 7 May 2003 09:35:36 -0400
From: "Haas, Matt" <Matt.Haas@xxxxxxxxxxxxxxxxxxx>
Subject: RE: How do I do HTTP GET, wait for response from a website?

Tom,

You'll need a sockets program to do this.

Brad Stone has a program called GETURI (http://www.bvstools.com) that I
think may have the source with it but it doesn't do SSL. He does have a
version that supports SSL but it isn't free.

As far as sockets programming goes, Scott Klement (don't have his website
address handy) has an excellent tutorial.

Matt

-----Original Message-----
From: Tom [mailto:tomh@xxxxxxxxx]
Sent: Wednesday, May 07, 2003 9:24 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: How do I do HTTP GET, wait for response from a website?



We're thinking about using an online credit card processing center.  Their 
requirement is that we package up our transactions and transmit them via 
http/https, and prevent the user from being able to view sensitive data in 
the data stream.

We use Net.Data for page presentation, and I can pretty easily pass 
parameters to an RPG program.  However, I have no clue on how to write an 
RPG program to do the next steps - send the GET command, and wait for (and 
process) the appropriate responses.

Anyone?


------------------------------

Message: 6
Date: Wed, 7 May 2003 09:38:09 -0400 
From: Buck Calabro <Buck.Calabro@xxxxxxxxxxxx>
Subject: RE: How do I do HTTP GET, wait for response from a website?

>However, I have no clue on how 
>to write an RPG program to do the 
>next steps - send the GET command, and 
>wait for (and process) the appropriate 
>responses.

You're looking at a sockets application.  The FAQ has some information on
sockets I think, http://faq.midrange.com.  Also, general web-type stuff can
be found at Easy400 web site at http://www-922.ibm.com.  Have a look at Brad
Stone's GETURI, from http://www.bvstools.com (from the Open Source section.)
  --buck

------------------------------

Message: 7
Date: Wed, 7 May 2003 09:11:08 -0500
From: "Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx>
Subject: RE: what is object oriented programming

> From: Bartell, Aaron L.
>
> <Joe>
> ...(Aaron, I suggest you get these as well, because they really
> show why you
> need to start from the ground up when
> designing OO architectures).
> </Joe>
>
> If this is from my statement of "you don't need to understand OO to make
> good use of it", I didn't mean that you shouldn't learn how to
> build simple
> base objects that can be extended upon.  I have already done some reading
> from those books (mostly from Bruce's).  Note** I am not a purist OO
> programmer.

As Hans says, in some ways OO is akin to a spiritual experience.  For
reasons far outside the scope of this list (considering this post is already
on the line), I believe that most procedural programmers require an epiphany
to "convert" to OO thinking.  Your above statement leads me to belive you
haven't reached that point yet.

Because OO is actually not about objects, not entirely.  It's about a frame
of mind where code is encapsulated and interfaces are defined and everybody
communicates via messages (in the strictest sense of OO, every interaction
between objects can be though of as a message - every method call is a
message with a bunch of parameters and a return code).

Hans and I disagree on the importance of data hiding to OO principles (in
every text I've read and every person I've talked to, the common practice in
OO is to hide all data members of a class and allow access only through
setters and getters - this is probably one of the strongest conventions in
OO today, and there is good reason for it), but we agree on the importance
of design patterns.  And you can't really design an OO system without using
design patterns of some kind; they're sort of like the simple machines of OO
programming.  Where engineers think of the pulley, the lever and the
inclined plane, OO designers think of the Decorator and the Factory.

Without understanding those basic tools and how they are used, you are
likely going to build applications that look like - well, that look like my
first projects.  Procedural ideas wrapped in OO skins.  It's ugly, because
you don't take advantage of any of the real benefits of OO design.  For
example, in OO you should program to the interface.  While the exact
implementation of this is different in different languages, it in essence
means that you never directly interact with another class.  You instead
interact with an idealized version of that class which everyone agrees upon.
You don't instantiate the class either, you invoke a Factory method which
gives you an instance of an object that implements the interface.  Why is
this important?  It's hard to explain in a single post, but it buys you an
enormous amount of flexibility down the road. Is it always necessary?  No,
but until you have worked with the concept a while, you're not in a position
to be able to decide wisely.

The point is, though, that if you don't code this way FROM THE START, it's
hell to go back and rearchitect your system.  Trust me on this.

Anyway, that's it for me.  As hard as we've all tried to keep this on topic,
this thread is destined to drift farther and farther from RPG.  Until and
unless you all decide to create an OO-L list, this is my last word on the
subject.

Joe


------------------------------

Message: 8
Date: Wed, 7 May 2003 10:20:03 -0400
From: "Steve Richter" <srichter@xxxxxxxxxxxxx>
Subject: back to: improving rpg.  was: what is object oriented
 programming


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Hans Boldt
Sent: Wednesday, May 07, 2003 8:02 AM

>> Procs could be declared as members of a data struct.  A data struct could
>> possibly
>> be declared with an "Is a" attribute which would be the equivalent of
base
>> classes in C++.  Maybe there could be "property get" and "property set"
>> members of a data struct.  Not knowing the secrets of ILE, even object
>> access operators ( struct1 >> CustMast // write a rcd to the file ) could
>> possible.

>Regarding adding "OO features" to RPG, well, I certainly think about
>that myself sometimes. But the scenarios always end up more or less
>the same - an ugly mish-mash of complex features, the type of
>language Rube Goldberg would be proud of. Or features with
>unacceptably poor performance. In other words, they'd end up making
>the language more difficult to use, not easier.

So now what I am talking about is "OO"!  First I am off topic, then I dont
know what I am talking about, then its not OO, now it is "OO", ...

Did /free make the language more difficult to use?  Did "qualified" and
"likeds" degrade performance, make an ugly mismash?  Of course it didnt!

By the same logic, why would the extension of /free to the data declare
specs not improve the language even more???

How is  "DataStruct.MemberProc( ... )" a rube goldberg construct?

If RPG is open sourced, IBM still makes its $$ thru the required websphere,
those who want IBM RPG can keep it, there is no need for an IBM run
committee, and the marketplace will decide quite efficiently whether a more
modular rpg is workable or not.

-Steve



------------------------------

Message: 9
Date: Wed, 7 May 2003 10:56:56 -0400
From: "Steve Richter" <srichter@xxxxxxxxxxxxx>
Subject: RE: Custom MONITOR handling

Hans, I hope you dont mind.  Did this get missed the other day? I posted it
a few days ago.  You had posted early last week re: using MONITOR to monitor
for os400 msgid messages. The code I posted in this message uses the "CEE"
APIs to do just that. Your post implied that this type of message monitoring
would not work in RPG. Can you explain why?

thanks,

Steve

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
Jon Paris wrote:
>  >> Is it possible to "throw" custom messages from a subprocedure?
>
> Nope - but I wish it was.  Hopefully Barbara or Hans are watching the
number
> of requests for this feature and we'll see it at some time in the future.
>
> You can of course cause an exception in one of a number of ways but if you
> want to supply your own code you're going to have to place it in a Global
> area or something.

Hans responded:

>John: I'd certainly like to see some improvements myself. But any
>improvements are probably going to work the way Buck described in
>his suggestion. That is, it would have to fit in with the whole
>OS/400 messaging protocol. Of course, a programmer can simply write
>his own easier to use wrapper for the send message API's, and then
>monitor for 1299 or 9999 (or whatever the default message id's are).

>But I'm still uncomfortable with the idea of using message handling
>for this type of thing. Although there are advantages to using a
>message based exception scheme, my own preference in this particular
>case would be to return an indication of success or failure using a
>status code.

I dont follow the problem of fitting rpg exception handling in with the
whole OS/400 messaging protocol.

Here is a way that the "Cee" APIs can be used to monitor for specific
message ids and either halt or promote those that are not monitored for.

Basically it functions the same as message handling in CL.

------------------------------------------------------------------
 /free
      MonMsg_Init( MonMsgCb ) ;
      pHandlerProc = %paddr(MonMsg_Handle) ;
      CeeHdlr( pHandlerProc: %addr(MonMsgCb): *Omit ) ;

  // run some monitored code
      MonMsg_BgnMon( MonMsgCb: 'CPF2817' ) ;
      qcmdexec( 'cpyf a b': 8 ) ;
      select ;
      when     MonMsgCb.SignalMsgid = 'CPF2817' ;
        fSndInfoMsg( 'monitored a CPF2817 message': 1 ) ;
      endsl ;
      MonMsg_EndMon( MonMsgCb ) ;

      CeeHdlu( pHandlerProc: *Omit ) ;

MonMsg_Init is a proc that clears the data struct passed to the exception
handler proc.

CeeHdlr is an ile proc that registers the exception handler of the calling
proc.

MonMsg_BgnMon is a proc that fills the MonMsgCb data struct with up to 10
message identifiers to be monitored for.

MonMsg_EndMon clears the MonMsgCb data struct of its msgids to monitor for.

CeeHdlu is an ile proc that unregisters the exception handling proc.

The MonMsg_Handle proc is called directly by ile. It is the proc that was
registered by the CeeHdlr call.  It basically retrieves the msgid of the
exception that was signaled ( thrown ), checks the MonMsgCb data struct for
the list of msgids being monitored for and proceeds from there.  The proc
returns codes that have meaning to ILE to either PERCOLATE the exception (
unmonitored ) or RESUME ( monitored ).

 ** -------------------- MonMsg_Handle ----------------------------
 pMonMsg_Handle    b
 dMonMsg_Handle    pi
 d InCond                              likeds(CondInfo)
 d pInMonMsgCb                     *   const
 d OutResult                     10i 0
 d OutNewCond                          likeds(CondInfo)

 d MonMsgCb        ds                  likeds(MonMsgCommBlock)
 d                                     based(pInMonMsgCb)

---------------------------------------------------------------------------

Is this not an acceptable way to handle exceptions in proc level rpg code?
The problems I have with it are:
 - a potential performance hit running the setup and take down code.
 - it is cumbersome to code procs this way.

The performance is something the programmer can decide.  The cumbersome
problem can be solved by enabling the MONITOR opcode to implement similar
CEE based code.

Steve Richter



------------------------------

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) digest list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo.cgi/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



End of RPG400-L Digest, Vol 2, Issue 276
****************************************

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.