Regarding Open I/O file overrides, I'm not sure where the conditional logic should go. Some RPG programmers use the extpgm(variableName) keyword on procedure prototypes at compile time, then fill in "variableName" to evoke handlers dynamically at runtime. Some ILE programmers use "rslvsp" and "QleActBndPgm" APIs at to dynamically resolve procedure pointers at runtime. If we use these kinds of mechanisms with program and procedure interfaces, why not offer something comparable with Open I/O interfaces?
Maybe the conditional logic should be in an Open I/O handler, but who's to say that the Open I/O handler might not use Open I/O itself, and be a wrapper around other Open I/O handlers?
Maybe Open I/O could be used to streamline the interface of an RPG based web services client, which performs an override, which interfaces with different web servers dynamically at runtime - perhaps based on user input.
----- Original Message ----
From: "rob@xxxxxxxxx" <rob@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Sent: Wed, October 21, 2009 2:18:27 PM
Subject: Re: IBM i "Open I/O" Architecture
I believe your handler is supposed to make the decision as to whether or not you are writing to cgi, palm, xml, etc. Not conditions in the program itself. Think of Scott's example of a printer writer. Would you rather just have a write statement in your RPG and the writers determine how to handle it or would you rather have
if (afpds) do this
do this other thing
No, all the IF logic should be in the handlers.