Anyone uses classes

Is anyone out there who has used classes (type 4) in a project on the mainframe (with the purpose to componentize a system).

What are you findings (pros/cons)?

I have tried to use classes and I noticed that it works recently well. I also see some interesting use cases. One of the things which are difficult to use are design patterns. Using classes opens up the possibility to apply design patterns (maybe not the whole set of the GoF, but this has to be investigated).

One of things you might for example accomplish (I have not tested it yet, but I will) is to implement observer pattern. I could for example implement a subject that sends out notifications to one or more observers, e.g. reading a work file and sending the records to any observer that’s interested. This is very hard (if not impossible) to implement using a procedural language. The only downside of this approach is that Natural that does not support multithreading (or does it?), since I do not want this process to be executed on one thread (it will block the executing thread).

Kind regards,
Rudolf

If I understand correctly you are about to create some kind of publish/subscribe - right ?
If you have EntireX in your env. you could take advantage of the pub/sub already implemeted there.
This would save you programming persistence etc etc.

Not much experience with natural Classes (4) myself, but I remember that there is a slight overhead for calling a “method” compared to calling a subprog directly. So be careful with scenarios with millions of calls :wink:

Finn

Hi Finn,

That’s not what I meant. I just want to know if there is a customer that seriously has tried (and even better, succeeded) building an application using Natural interfaces and classes.

I have made a few implementations using classes. The way it has been implemented by SAG is a bit awkward, but workable. It has some similarities with VB6.

Connecting subprograms to methods does give me some opportunities, that are not possible with VB6. You could simulate inheritance, but you must do it yourself. It’s rather unique ;-).

Personally I find it a shame that properties are used to directly connect to data. One of the beauties of properties is that you can control the access, e.g. creating a property named age that’s derived from date of birth.

I also would also like to know what SAG intends to do in the future (roadmap).

Rudolf