Changes in superclass are not reflected in subclasses.
Author |
Message |
anit #1 / 3
|
 Changes in superclass are not reflected in subclasses.
Quote: > > I have encountered a problem whereby I have make some changes to some > > components (eg. menu bar) in the UI superclass, then I versioned and > > released it. In the UI subclasses, I can't seem to see the changes. I'm not > > sure whether the changes of UI components made in the superclass will be > > inherited to its subclasses. Is there a way that I would be able to see the > > changes in the subclasses? > Unfortunately, in VisualAge, there is no Visual inheritence. > There is in WindowBuilder, and there is in VisualWorks. > You can build your windows programmatically to get inheritence if you really > like. We use visual parts as templates for building a window.
... and that is why we adopted as a standard not to express behavior using "graphical programming" i.e. connections or links that the VisualAge IDE allows developers to use. If in the superclass UI you had a button and you create subclasses UIs, and then, oops, you realized you forgot to put a connection between the button's click event and some other action, you go back to edit graphically the superclass UI, but then, surprise surprise, when you run the subclass UI, pressing that button doesn't do anything. If instead the superclass has that behavior expressed textually in code, as for example by having this line in #finalInitialize, "self myButton abtWhen: #click perform: (#myButtonPressed asMessageTo: self)", then there would be no problem. the keyword here is "snapshot": when subclass UIs are created in the Visual Organizer, they take a once-at-creation-only copy of the superclass, and any changes added later to the superclass will never be transfered to the subclasses.
|
Tue, 20 Apr 2004 08:30:42 GMT |
|
 |
Claudio Roitma #2 / 3
|
 Changes in superclass are not reflected in subclasses.
Quote: > > Unfortunately, in VisualAge, there is no Visual inheritance.
"Visual" classes are not different from the other classes. You have the same inheritance mechanism in the whole Smalltalk hierarchy. The problem You have is not about inheritance, Its about the composition editor, The graphical tool for building GUIs in VAST. It creates a method named #abtBuildInternals containing the code for drawing the GUI and making connections between attributes, events, actions and scripts. The problem is: When You create a VisualPart A, as a subclass of another VisualPart B, the composition Editor creates the B>>#abtBuildInternals, that overwrites the method A>>#abtBuildInternals ... so... B losses A widgets and connections..... Claudio
Quote: > > > I have encountered a problem whereby I have make some changes to some > > > components (eg. menu bar) in the UI superclass, then I versioned and > > > released it. In the UI subclasses, I can't seem to see the changes. I'm not > > > sure whether the changes of UI components made in the superclass will be > > > inherited to its subclasses. Is there a way that I would be able to see the > > > changes in the subclasses? > > Unfortunately, in VisualAge, there is no Visual inheritence. > > There is in WindowBuilder, and there is in VisualWorks. > > You can build your windows programmatically to get inheritence if you really > > like. We use visual parts as templates for building a window. > .... and that is why we adopted as a standard not to express behavior > using "graphical programming" i.e. connections or links that the > VisualAge IDE allows developers to use. If in the superclass UI you > had a button and you create subclasses UIs, and then, oops, you > realized you forgot to put a connection between the button's click > event and some other action, you go back to edit graphically the > superclass UI, but then, surprise surprise, when you run the subclass > UI, pressing that button doesn't do anything. If instead the > superclass has that behavior expressed textually in code, as for > example by having this line in #finalInitialize, "self myButton > abtWhen: #click perform: (#myButtonPressed asMessageTo: self)", then > there would be no problem. > the keyword here is "snapshot": when subclass UIs are created in the > Visual Organizer, they take a once-at-creation-only copy of the > superclass, and any changes added later to the superclass will never > be transfered to the subclasses.
|
Wed, 21 Apr 2004 03:11:12 GMT |
|
 |
Eric Clayber #3 / 3
|
 Changes in superclass are not reflected in subclasses.
Quote: > > > Unfortunately, in VisualAge, there is no Visual inheritance. > "Visual" classes are not different from the other classes. You have the same > inheritance mechanism in the whole Smalltalk hierarchy. > The problem You have is not about inheritance, Its about the > composition editor, The graphical tool for building GUIs in VAST.
*One of* the tools for building GUIs in VAST. Don't forget WBPro... http://www.instantiations.com/sts/wbp.htm ...which also nicely supports visual inheritance and subclassing. -Eric Clayberg Sr. Vice President of Product Development Instantiations, Inc.
http://www.instantiations.com
|
Thu, 22 Apr 2004 10:36:18 GMT |
|
|
|