×
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.
What is an indisputable fact is that RPG and Cobol are not suitable
for "object oriented programming". That is, the languages themselves
do not provide support for the specific programming paradigm currently
referred to as OOP. You could actually try to build up an ad-hoc OOP
system in RPG or Cobol (they are, after all, Turing-complete
languages), but it would be ridiculously complicated and not worth
anyone's time or trouble.
Say you create a service program that implements attributes and methods
pertaining to an object, say "car"? One of the procedures in the service
program implements a factory method for instantiating and returning a
reference to a car? For example:
make = 'Ford';
model = 'F150";
year = 2016;
car = carNew(make:model:year);
The value in the variable "car" might be a basing pointer to a data
structure that contains all the attributes pertaining to an instance, which
is dynamically allocated by the carNew() function.
From that, you might implement all sorts of methods, which operate on that
instance, for example:
carSell(car);
Isn't that object oriented?
The most essential attribute of OO design and development is encapsulation.
ILE service programs are nearly identical to "classes" in that regard.
What about inheritance? Why not create service programs which are wrappers
around other service programs?
What about polymorphism? Optional parameters may not change the signature
of procedures, but they typically modify their behavior. One idea for
changing the signature and behavior of a procedure is to dynamically return
procedure pointers from different service programs, based on what you might
want to implement.
ILE languages may not all the characteristics of OO languages. But it
sounds like you may not have been aware of what they do offer.
As an Amazon Associate we earn from qualifying purchases.