ABL equivalent for "RUN ... ON SERVER"

DevTeam

Member
Hi,

I have been searching the online KB and I haven't been able to find something equivalent to :
Code:
RUN myProgram.p PERSISTENT SET progHndl ON SERVER srvHndl.
with ABL classes, that is to say instanciating a remote .cls file..

Something like that in fact :
Code:
DEF VAR instClass AS CLASS myClass NO-UNDO.
instClass = NEW myClass() ON SERVER srvHndl.

Does it ring a bell in someone's mind ?

Thanks in advance.
 

lord_icon

Member
Scoping

Greetings,
You need to be scoped to the server. Instead of the single instance executing on the server. The block needs to be scoped to the server. Much the same way as in a frame.
How you would do with frame {&frame-name}, you need to be doing the block scoped to the server.
 

DevTeam

Member
Re: Scoping

Greetings,
You need to be scoped to the server. Instead of the single instance executing on the server. The block needs to be scoped to the server. Much the same way as in a frame.
How you would do with frame {&frame-name}, you need to be doing the block scoped to the server.

Hi,

Thanks for your answer.

I'm sorry but I did not understand what you meant by "scoped to the server". And as I have never had to work on user interface, your example with the frame means nothing to me :eek:


Maybe it's my bad, I'll try to explain what I'm looking for in a different way.
What do I have to do - on the client side - to instanciate
a remote class and then get its handle ? I'm stuck.......
 

DevTeam

Member
The only way I have in mind is to keep instanciating a .p file which will only be used as a switch...

Client side :
Code:
RUN myProgram.p PERSISTENT SET progHndl ON SERVER srvHndl.
RUN helloWorld IN progHndl.

Server side :
Code:
/* Program.p */
DEF VAR instClass AS CLASS myClass NO-UNDO.
instClass = NEW myClass().

PROCEDURE helloWorld :
  instClass:helloWorld().
END PROCEDURE.

Code:
/* myClass.cls */
CLASS myClass :
  METHOD PUBLIC VOID helloWorld() :
    /* ... */
  END METHOD.
END CLASS.

But I'm quite sure it won't be performant... :(
 

DevTeam

Member
Okay, I have my answer...

Found ARCH-9_Fechner.pdf document from Progress Exchange 2007 :

Code:
Usage of classes on the AppServer
• The AppServer protocol/server handle does not
support classes
  – No remote invocation of classes over the AppServer boundary
  – Can’t pass a class as an parameter to a remote procedure

No support for remote invocation
  • Client is unable to create instance on AppServer
  • At first sight looks like a real show stopper
  • But it shouldn’t be high on an architects wish list anyway
     – Classes behave similar to persistent procedures at run time
     – Would require state-aware or stateless-bound
     – One call for constructor, second call for method call, third call for destructor
     – Wouldn’t scale well in most environments
 
Top