Plug-in mechanism

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Plug-in mechanism

Leon van Dyk
Hi newsgroup readers

In a unmanaged language (C, C++, Delphi) you can write an extensible
program by providing for a plug-in mechanism, e.g. by allowing the
application to load DLL's at runtime.

What sort of mechanisms if any are there in Dolphin Smalltalk, to
provide for a dynamic plug-in mechanism, to extend the functionality of
a deployed application.  Is there for example a way to load a patch
(extension) image or something similar.

Regards,
Leon


pax
Reply | Threaded
Open this post in threaded view
|

Re: Plug-in mechanism

pax
Leon,

Dolphin Smalltalk can be used to patch a runtime image. The image
itself is closed i.e., development tools/classes have been removed.
Therefore, everytime the application is launched, it will need to check
for available patches and load them from a specific or patch directory.


You can create any number of new/modified methods for a given class;
save them in an external file then load them into the runtime image as
follows:

MyClass compile: aMethodSourceString. aMethodSourceString is a textual
representation of the new/modified code you created. Furthermore, you
can put all of your code changes into a binary filed object and load
that file during application startup. Then simply iterate over the file
in memory and load/execute code changes that are in the file.  This
strategy provides one file to load and process opposed to multiple
files.

Patching a deployed application in this manner is convenient. Rather
than deploying a new image for every bug or enhancement, you simply
deploy a patch for the application that is loaded at runtime. I would
imagine that after a significant number of patches has been
created/installed, it would be prudent to create a new version of the
app for deployment.

This strategy requires the Dolphin Compiler to ship with your
application. This can be done without violating the End User License
Agreement (EULA).  For additional information, run a search using the
keyword(s) "runtime patch" in the ng. There are several thread where
such implementations have been discussed.

Regards,

Pax


Reply | Threaded
Open this post in threaded view
|

Re: Plug-in mechanism

Sean M-8
In reply to this post by Leon van Dyk
"Leon" <[hidden email]> wrote in message
news:[hidden email]...

> Hi newsgroup readers
>
> In a unmanaged language (C, C++, Delphi) you can write an extensible
> program by providing for a plug-in mechanism, e.g. by allowing the
> application to load DLL's at runtime.
>
> What sort of mechanisms if any are there in Dolphin Smalltalk, to
> provide for a dynamic plug-in mechanism, to extend the functionality of
> a deployed application.  Is there for example a way to load a patch
> (extension) image or something similar.

The simplest way is to just use the Compiler class. You can just dynamically
load in code and execute it.

Another way is via binary packages loaded at runtime. (Do a search through
the archives for posts on binary packages)

Dynamically loaded/plugin code @ runtime is a particular strength of
Smalltalk given you're just operating within the standard confines of the
environment. Making it work in Dolphin is dead easy.


Reply | Threaded
Open this post in threaded view
|

Re: Plug-in mechanism

Leon van Dyk
Pax & Sean

Thanks for the replies.

Leon