GUI for .NET: calling a method in OOABL from C#?

Posted by GSchug on 21-Oct-2013 23:48

We are using GUI for .NET. For performance reasons we are implementing our own C# assembly that does some UI rendering. This assembly (UserControl) is displayed in an GUI for .NET - OOABL environment.

In this environment, we easily can call methods in the C#-world. But when in C#, we cannot easily run methods in the OOABL. One way is to publish an event and subscribe to that event in OOABL. Events can have parameters and these parameters might be a little bit more complex. Even input-output parameters are possible, but in my opinion this is  a misuse of this.

So we've had the idea to have an abstract class in C# with empty methods in it. In OOABL we then inherit from this class and overwrite these methods. In C# we can now run these methods which finally executes in the OOABL. By doing so, we can have more complex and structured parameter sets.

This way of communication seems to work. Before we start using this idea in our product, I'd like to ask whether this is supported or not.

Are there other suggestions?

Posted by Matt Baker on 22-Oct-2013 07:51

Your best option is to use an abstract class/methods and override them in the ABL.  And yes, its supported.

All Replies

Posted by Matt Baker on 22-Oct-2013 07:51

Your best option is to use an abstract class/methods and override them in the ABL.  And yes, its supported.

Posted by ujj1 on 22-Oct-2013 09:32

It can be done.  You can have ABL classes inherit from dotnet classes.  In your case since it sounds like you have empty methods, you may want to consider creating interfaces in dotnet which your ABL class will implement.  

Something like:

Dotnet:

interface DotNet.ICar

{

   public void Start();

}

public class Driver

{

    public void StartCar(ICar car)  

    {

           car.Start();

    }

}

class ABL.Car implements DotNet.ICar:

   method public void Start():

       message 'vroom'.

   end.

end.

MyABLProgram.p:

define variable aDriver as Driver no-undo.

aDriver = new Driver().

define variable anABLCar as ABL.Car no-undo.

anABLCar = new ABL.Car().

aDriver:StartCar(anABLCar).

This thread is closed