On 20/09/2022 10:56 pm, Michael Stein wrote:
I have been coding in C++ and Java for so long OOP is second nature to me
now. Well, in C++ I prefer the interfaces using templates. Java has morphed
into into a hybrid OO/FP language since the introduction of the Streams API
in Java 8. It's common now not to code imperative loop statements at all.
One can use object based programming in any language that supports function
pointers. I have seen a lot of HLASM code that would benefit from such a
design. One of the key principles of OO was to replace conditional logic
with polymorphic types. An example in C is the z/OS stdio library. fopen()
is a factory function that returns an opaque handle with read/write/close
functions pointers set that can handle many different access methods using
the same abstract functions. This is a clean design that unfortunately isn't
as common as it should be.
And when you open a DCB for QSAM you don't care about the device type...
Not quite what I was talking about which is polymorphism. For example,
fopen() can instantiate QSAM, BSAM, VSAM (KSDS, RRDS, ESDS), Hiperspace,
z/OS UNIX file etc. I have no doubt that object based design is possible in
assembler but I have never seen it. I've seen plenty of structured
programming using macros. The majority of HLASM programmers haven't been
exposed to OOP so don't look to solve problems using that paradigm.
How old is that design?
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN