In my current little project I would like write classes in Smalltalk. However, when I am designing the classes I do not know, which instance variables the class should have.<br><br>While I am running the application, the user (or another agent) determines which instance variables should be assigned to a class.<br>How can I add instance variables and possibly class variables to a class, while the program is running ? Actually how can the Smalltalk code be automatically transformed (and "accepted") from the 'BEFORE' state to the 'AFTER' state.<br><br>// BEFORE //<br>Object subclass: #Class1<br>&nbsp;&nbsp;&nbsp; instanceVariableNames: ''<br>&nbsp;&nbsp;&nbsp; classVariableNames: ''<br>&nbsp;&nbsp;&nbsp; poolDictionaries: ''<br>&nbsp;&nbsp;&nbsp; category: 'some-category'<br><br>// AFTER //<br>Object subclass: #Class1<br> &nbsp;&nbsp;&nbsp; instanceVariableNames: 'InstVar1 InstVar2 '<br> &nbsp;&nbsp;&nbsp; classVariableNames: 'ClassVar1 ClassVar2'<br> &nbsp;&nbsp;&nbsp;
 poolDictionaries: ''<br> &nbsp;&nbsp;&nbsp; category: 'some-category'<br><br>I worked with the ClassBuilder class, but I haven't achieved this kind of automated code transformation.<br>Let's assume the desired variable names are available as normal strings and should be added one after another (method like: addNewInstanceVariable: aString ).<br><br>Don't worry about getter/setter methods for the new instance variables, that's another issue.<br><br><br>Thanks in advance<br>Warakorn<br><p>&#32;

<hr size=1>Want to start your own business? Learn how on <a href="http://us.rd.yahoo.com/evt=41244/*http://smallbusiness.yahoo.com/r-index">Yahoo! Small Business.</a>