Re: How to make a plugin?
Re: How to make a plugin?
- Subject: Re: How to make a plugin?
- From: Stéphane Sudre <email@hidden>
- Date: Fri, 27 Jul 2001 12:00:55 +0200
On vendredi, juillet 27, 2001, at 01:14 AM, Chris Hanson wrote:
At 11:37 AM +0200 7/26/01, Georg Tuparev wrote:
I was doing this on NeXTstep. You can unload a class, but is a tricky
stuff. There should be no holes in the class stack. Did not tried it on
OSX though...
Unfortunately there's no support in NSBundle for unloading. I think
there should be.
While class/bundle unloading might be "hard" it's not an unsolvable
problem. You can always just declare a bundle unloadable if and only
if (a) no classes will derive from any classes defined in the bundle,
(b) no instances of a class defined in the bundle exist, and (c) the
bundle does not declare any categories on classes external to the
bundle. NSBundle could detect conditions (a) and (c) at bundle load
time and mark the bundle as permanently loaded (and throw an exception
if it receives -unload). Developers could probably be relied upon to
do the right thing with respect to condition (b).
This would make it possible to build a component software architecture
like OpenDoc rather simply on top of Cocoa. It can't be done optimally
without unloading support because for instance you can't (say) have a
compound document open and decide to upgrade one of your editor parts
before using it. Without unloading you have to quit your document,
upgrade your editor part, and re-launch your document.
I'm currently trying to understand why CFBundleUnloadExecutable doesn't
work when I call it so that may be why it's not possible with NSBundle
too.