On the vwnc mailing list, a question came up about loading patch parcels at runtime:
I'm having problems loading "patch" parcels into a runtime image, because Overrides happen to access class comments and method sources (which are absent from the runtime product). It's getting more and more frustrating to poke around in the Override class tree and apply fixes here and there ... Is there a better and simpler solution for this?
As it happens, I load updates at runtime in BottomFeeder, and those updates have had to deal with the same problems. You have to be ready to handle a few exceptions during the parcel load. In a development image, you'll get prompted for some of these issues, whereas in a runtime you just want to have the load happen. Here's the code I use:
[[Parcel loadParcelFrom: parcelFile] on: Parcel parcelAlreadyLoadedSignal, CodeStorageError
do: [:ex | ex resume: true]]
on: DuplicateBindingsError
do: [:ex | ex resume]
What that does is ignore overrides and "already loaded" issues, and just plows forward. For some applications, you might care more deeply about those exceptions, and want to act differently.
Technorati Tags:
smalltalk