[fpc-pascal] Adding method dynamically to a class

Inoussa OUEDRAOGO inoussa12 at gmail.com
Wed Jun 20 13:15:54 CEST 2012


> Think of a plug-able system.  I have an engine, and code to execute.
> Instead of compile everything to an ELF/PE, I place code on dynamic shard
> library, and load it on run time when needed.
>
> The idea is that the engine will not be rewritten for every new request
> (that comes often), because it's logic (almost) never changes, but to load
> code on demand that often changes, provide additional functions, changes of
> logic, bug fixes etc...

WST library server implementation could be a elegant solution : it is
web-services that are
locally located in dynamic library(DLL)/shared object(so) instead of
being remote. The main
 executable acts as client while the server's implementation as
provided as shared objects.
No TCP is used, only memory through the WST's library protocol. No
SOAP serialization
as you can use the WST's custom binary messaging format that is very fast.

To resume :
  * The main executable defines a WSDL schema that contains the types
(think of this as IDL)
  * The servers implement the service exposed in the schema.
  * The main executable loads the servers using the library protocol

Main benefits are :
  * much larger type system available (wsdl, WST contains a type library editor)
  * you could later even add remote servers without changing your main
application,
    just create the service with the desired location parameters.



-- 
Inoussa O.



More information about the fpc-pascal mailing list