Class instance variables
You can unload a collection of class instance variables either with their current values or with values that you set. ENVY/App unloads all class instance variables of applications and subapplications (except those of subApplications and dependentApplications) when it unloads those components. You must explicitly unload class instance variables of other classes.
You use the method dumpClassInstVar:in: to unload class instance variables with their current values, and dumpClassInstVar:withValue:in: to unload them with new values.
Prior to executing the code in this example, load packaging instructions and create an instance of EaComponentMapManager called ComponentMaps by executing Step 1 of Example: Unloading an application and its subapplications.
Example: Unloading class instance variables
Suppose classes named Alpha and Beta have the following definitions:
Object subclass: #Alpha
classInstanceVariableNames: 'a b'
instanceVariableNames: 'c d'
classVariableNames: 'E F'
poolDictionaries: 'G'
Object subclass: #Beta
classInstanceVariableNames: 'h i j'
instanceVariableNames: 'k l'
classVariableNames: 'M'
poolDictionaries: 'N'
To unload the class instance variable "a" in Alpha with its current value and the class instance variable "h" in Beta with a value of 1000 into a file named both.ic, you use statements in the following code fragment:
"Step 2: Unload the class variables a and h into both.ic."
| result |
(result := ApplicationDumper new)
...
dumpClassInstVar: 'a' in: Alpha;
dumpClassInstVar: 'h' withValue: 1000 in: Beta;
...
dumpIntoFileNamed: 'both.ic' path: '.' using: ComponentMaps.
...
Last modified date: 01/29/2015