running DWT with DDL

Tom S h3r3tic at remove.mat.uni.torun.pl
Wed May 28 14:43:23 PDT 2008


Perhaps a little background info might be useful. Frank had a few rather 
tricky requirements:

1. There is a large library which should be shared across applications
2. There are plugins to the library
3. Applications must be able to derive classes from the ones in plugins
4. Plugin implementations may be changed post-deployment. In other 
words, the app may not know the source or binary code of the plugins in 
advance.

1. itself is a tough issue on Windows, as DLLs are not D - friendly.
2, 3, and 4 mean that the application has classes whose code parts are 
not known until the plugins are loaded. While it might be solved with 
some fancy design patterns, it would be nice if the setup worked out of 
the box without any hacking around.

But how can we have an executable that derives from classes whose 
implementation is not known - it's in .di files? As far as I know, one 
can't have incomplete executables on Windows or Linux. (executables with 
unresolved symbols).

Here's where DDL steps in. There are perhaps more solutions, but we've 
employed a version where there's a 'host' executable that loads the 
application, the lib (and potentially the plugins) dynamically. The host 
links them all together using DDL and then starts the app. As a result, 
we only have one executable (and as Frank said, it can be shared across 
apps) and lots of libs that are loaded thru DDL. As libs may be 
incomplete, all problems are solved right away.


-- 
Tomasz Stachowiak
http://h3.team0xf.com/
h3/h3r3tic on #D freenode


More information about the Digitalmars-d-dwt mailing list