Re: How to make a plugin?
Re: How to make a plugin?
- Subject: Re: How to make a plugin?
- From: Chris Hanson <email@hidden>
- Date: Thu, 26 Jul 2001 18:14:36 -0500
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.
-- Chris
--
Chris Hanson <email@hidden>
bDistributed.com: Making business distributed.
Personal email: <email@hidden>