• Subject: Re: Writing an Open Access handle that will either read/write to the Db2 file or make a REST call
  • From: "D*B" <dieter.bender@xxxxxxxxxxxx>
  • Date: Wed, 16 Jan 2019 20:25:42 +0100
  • Arc-authentication-results: i=1; mx.google.com; spf=neutral (google.com: is neither permitted nor denied by best guess record for domain of dieter.bender@xxxxxxxxxxxx) smtp.mailfrom=dieter.bender@xxxxxxxxxxxx
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=importance:content-transfer-encoding:mime-version:date:subject:to :from:message-id; bh=bITnJJjNUpdRhNpNl3Le4nhFVKeSSPUvo/KUZKFMXP4=; b=CGXPpOtCxSeVMJeW7Ki9WSEVK3cmGzxiKzPRo+TSATm/U2Cw2z3WDKl3/RbpZWAzV/ ze3lYruqB9d8IbTE4ht0oK5ZRBnltG0vvXvervejek0EqeuqUl8a5NgSD0ob7horq+Dg Ynnr3SZ0F4+zpdL1I9wIfwRipzjJrwWEMum8gnLmQIhDGJRgfkO604sCWrMkkG7sudpy 5kRkCGau2TYaTnRKtFtdjdrLFvJqIfsf55qOvvjEqtzQCZv53o4fURe0KMt6f62fjxoF zMoNHfOmvkgIuGlS/Yz3i4g536WDeoRBV+0vgNKsqA/hyH4kA1F9Ifh+tqNi1uXsHOrP bcpg==
  • Arc-seal: i=1; a=rsa-sha256; t=1547666729; cv=none; d=google.com; s=arc-20160816; b=x0niQ24F+wKSw/nVCMLxoL0t3/+1ds1Rw75AycFSHZURqT+brxN3xQwnOWd2Y2yoVx oO7Upw7isUZVJtRv2/gwiHnMxYAjbCYvC1BTk0HX6jlA1hNBYlPNQhALk3LQf7CnYWtp K9wyeO7ny4I3P7RzRekcdQMDoYXbrggrBP1opXLz1AL+X4AGVeXv6a0wm2omMTRv5lvV N58uYCEfNWWP2UR2i9llrN3SZEDYcFCl6hJzRLAXI+Yw2pceJL3ywuHfHJ0EjQONdTHI ZdoKD/hdI5NMLF5kh+CdIPMGtoZadSv8C9yq5zHKSuCFwgIAofNEFtCevmEFk3tufpcx j+Lw==
  • List-archive: <https://archive.midrange.com/rpg400-l/>
  • List-help: <mailto:rpg400-l-request@lists.midrange.com?subject=help>
  • List-id: "RPG programming on the IBM i \(AS/400 and iSeries\)" <rpg400-l.lists.midrange.com>
  • List-post: <mailto:rpg400-l@lists.midrange.com>
  • List-subscribe: <https://lists.midrange.com/mailman/listinfo/rpg400-l>, <mailto:rpg400-l-request@lists.midrange.com?subject=subscribe>
  • List-unsubscribe: <https://lists.midrange.com/mailman/options/rpg400-l>, <mailto:rpg400-l-request@lists.midrange.com?subject=unsubscribe>

Because an API call cannot take advantage of RPG's automatic data marshalling features. I often think that this was a major factor in the slow adoption by RPGers in general of web programming. Having to call an API for each and every field that is to be sent to the browser is a very different thing from simply doing (say) EXFMT.

You and I embraced the API approach - to many others it just looked like it was going to be worse than coding assembler or COBOL. Way too much typing.

Your example is frankly a little silly. The handler has to be named on the File definition so the purpose and limitations are somewhat obvious. If the handler is called ReadIFS then the programmer is hardly likely to expect it to eat with CHAIN. Just as they would not expect to use CHAIN with the target file that resulted from CPYTOIMPF that the handler is avoiding the necessity for.

The major reason for defending against unsupported op-codes is that OA does not provide a means by which the handler can identify to the compiler which operations are supported. As a result a maintenance programmer seeing that a file is keyed might be tempted to try to use SETLL if they are not thinking about which handler they are using. The compiler cannot defend against that so the handler must. Or the handler be modified to deal with such requirements if thy make sense in terms of the underlying technology.

@API or not: There is no need to call an API for every field, that is nearly as silly as the internal API interfaces of OA (I don't have so much experience with) or the ARDPGM interface (I do have some experience with). We could provide interfaces very similar to the external interface of OA, something like call someProc(recordType record) bringing back a well defined record - all needed conversion stuff and interpreting the record is done encapsulated in someProc.

@myExample: did you really read it? I was talking about chain and somebody trying setll/read, two ways done with a keyed file, both reading methods - how should one name the file? chainOnlyDoNotSetxxKeyedFile perhaps? BTW: the compiler can't defend against using unsupported OpCodes, as OA implementation is very limited, a little bit like the free format compiler at times it needed nonsens statements like /free /end-free. Minimum would be to me some mechanism like Procedure interface definition to ensure that OA implementation and usage do fit with each other.

The real difrence between your recommendations and mine are:
I do strongly recoomend: Don't use RLA in newly created programms, it's riding a death horse.


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 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].