right way to override class/method defs in StORE 
Author Message
 right way to override class/method defs in StORE

I'm sorry if this has been asked before - a deja search pulled up
lots of messages that you *can* do this, not *how*.

I'm working on porting our VW3+ENVY code to VW5i.4+StORE.  I want to
take advantage of StORE's capability to store overridden class defs
and methods in a package other than the original.  I created a new
package and set it as the Current Package.  I then started applying
changes to the FontDescription class.

First, I changed the class definition by adding an inst var.  I
noticed the class did not show up in my new package.  Looking around,
I found a menu option Class...Move definition to package..., so I
used that and it allowed me to choose my new package, and the class
showed up as expected in the new package.  I then added some new
methods, which showed up, bolded, in the new package.  Finally, I
modified an existing method, #initialize, which remained unbolded
in the new package.  I found a right-button menu option to move
this to the new package, so I tried that.  It then appeared bolded
in my new package.

Here are my questions:
1. Generally, is this the "right" way to organize base class changes?
2. When I look at FontDescription in the Graphics-Fonts package, it
   is now unbolded.  Also, the initialize-release protocol, which only
   contains #initialize, is unbolded.  Does this mean that the class
   and the #initialize method are no longer a part of the Graphics-Fonts
   package or merely that a different version (in my new package) is
   loaded?  
3. If the former, is there a way to add just the new definition to the
   new package, leaving the old package untouched?
4. Adding to 2 and 3, the package browser now shows the Graphics-Fonts
   package and its containers with a +, indicating that they extend
   other packages.  Shouldn't they have a -, indicating that they
   contain classes extended by my package?
5. Is there more detailed documentation on StORE somewhere (other than
   the VisualWorks Application Developer's Guide)?  Quite frankly I
   was unable to follow the discussion of overrides in the Change List
   chapter.

TIA for any help!

-Christopher



Tue, 13 Apr 2004 03:16:43 GMT  
 right way to override class/method defs in StORE

Quote:

> I'm sorry if this has been asked before - a deja search pulled up
> lots of messages that you *can* do this, not *how*.

> I'm working on porting our VW3+ENVY code to VW5i.4+StORE.  I want to
> take advantage of StORE's capability to store overridden class defs
> and methods in a package other than the original.  I created a new
> package and set it as the Current Package.  I then started applying
> changes to the FontDescription class.

> First, I changed the class definition by adding an inst var.  I
> noticed the class did not show up in my new package.  Looking around,
> I found a menu option Class...Move definition to package..., so I
> used that and it allowed me to choose my new package, and the class
> showed up as expected in the new package.  I then added some new
> methods, which showed up, bolded, in the new package.  Finally, I
> modified an existing method, #initialize, which remained unbolded
> in the new package.  I found a right-button menu option to move
> this to the new package, so I tried that.  It then appeared bolded
> in my new package.

> Here are my questions:
> 1. Generally, is this the "right" way to organize base class changes?

It's one way.  You can also change the Store>>Settings pages so as to
have things happen more like you want them to.

Quote:
> 2. When I look at FontDescription in the Graphics-Fonts package, it
>    is now unbolded.  Also, the initialize-release protocol, which only
>    contains #initialize, is unbolded.  Does this mean that the class
>    and the #initialize method are no longer a part of the Graphics-Fonts
>    package or merely that a different version (in my new package) is
>    loaded?  

Within that image, you physically moved them.  Load into a fresh image,
and you'll see an override.  Yes, this could be clearer ;-)

- Show quoted text -

Quote:
> 3. If the former, is there a way to add just the new definition to the
>    new package, leaving the old package untouched?
> 4. Adding to 2 and 3, the package browser now shows the Graphics-Fonts
>    package and its containers with a +, indicating that they extend
>    other packages.  Shouldn't they have a -, indicating that they
>    contain classes extended by my package?
> 5. Is there more detailed documentation on StORE somewhere (other than
>    the VisualWorks Application Developer's Guide)?  Quite frankly I
>    was unable to follow the discussion of overrides in the Change List
>    chapter.

> TIA for any help!

> -Christopher



Tue, 13 Apr 2004 04:00:10 GMT  
 right way to override class/method defs in StORE

Quote:



<snip>

Quote:

> > Here are my questions:
> > 1. Generally, is this the "right" way to organize base class changes?

> It's one way.  You can also change the Store>>Settings pages so as to
> have things happen more like you want them to.

Jim, I must be missing something.  The Store>>Settings pages seem to
only have settings for *new* classes, methods, and shared variables.
It doesn't seem to have settings for new instance variables (new class
definition) or for overrides to existing methods.  I already have the
settings for new methods, etc., set to use my new package.

-Christopher



Tue, 13 Apr 2004 04:17:21 GMT  
 right way to override class/method defs in StORE
No, you aren't missing anything.  I answered the wrong question though ;-)
Quote:



> <snip>

>>>Here are my questions:
>>>1. Generally, is this the "right" way to organize base class changes?

>>It's one way.  You can also change the Store>>Settings pages so as to
>>have things happen more like you want them to.

> Jim, I must be missing something.  The Store>>Settings pages seem to
> only have settings for *new* classes, methods, and shared variables.
> It doesn't seem to have settings for new instance variables (new class
> definition) or for overrides to existing methods.  I already have the
> settings for new methods, etc., set to use my new package.

> -Christopher



Tue, 13 Apr 2004 04:27:08 GMT  
 right way to override class/method defs in StORE
A shorter question, if you prefer: if you are using StORE, where
do you put your base class changes (not just extensions), and
how?

-Christopher

Quote:

> I'm sorry if this has been asked before - a deja search pulled up
> lots of messages that you *can* do this, not *how*.

> I'm working on porting our VW3+ENVY code to VW5i.4+StORE.  I want to
> take advantage of StORE's capability to store overridden class defs
> and methods in a package other than the original.  I created a new
> package and set it as the Current Package.  I then started applying
> changes to the FontDescription class.

> First, I changed the class definition by adding an inst var.  I
> noticed the class did not show up in my new package.  Looking around,
> I found a menu option Class...Move definition to package..., so I
> used that and it allowed me to choose my new package, and the class
> showed up as expected in the new package.  I then added some new
> methods, which showed up, bolded, in the new package.  Finally, I
> modified an existing method, #initialize, which remained unbolded
> in the new package.  I found a right-button menu option to move
> this to the new package, so I tried that.  It then appeared bolded
> in my new package.

> Here are my questions:
> 1. Generally, is this the "right" way to organize base class changes?
> 2. When I look at FontDescription in the Graphics-Fonts package, it
>    is now unbolded.  Also, the initialize-release protocol, which only
>    contains #initialize, is unbolded.  Does this mean that the class
>    and the #initialize method are no longer a part of the Graphics-Fonts
>    package or merely that a different version (in my new package) is
>    loaded?
> 3. If the former, is there a way to add just the new definition to the
>    new package, leaving the old package untouched?
> 4. Adding to 2 and 3, the package browser now shows the Graphics-Fonts
>    package and its containers with a +, indicating that they extend
>    other packages.  Shouldn't they have a -, indicating that they
>    contain classes extended by my package?
> 5. Is there more detailed documentation on StORE somewhere (other than
>    the VisualWorks Application Developer's Guide)?  Quite frankly I
>    was unable to follow the discussion of overrides in the Change List
>    chapter.

> TIA for any help!

> -Christopher



Tue, 13 Apr 2004 23:06:44 GMT  
 right way to override class/method defs in StORE
I typically create a separate package for that (See VRUIPainterPreReq2
for an example).  As to how I get them there, after I override a method,
I move it to the new package.
Quote:

> A shorter question, if you prefer: if you are using StORE, where
> do you put your base class changes (not just extensions), and
> how?

> -Christopher


>>I'm sorry if this has been asked before - a deja search pulled up
>>lots of messages that you *can* do this, not *how*.

>>I'm working on porting our VW3+ENVY code to VW5i.4+StORE.  I want to
>>take advantage of StORE's capability to store overridden class defs
>>and methods in a package other than the original.  I created a new
>>package and set it as the Current Package.  I then started applying
>>changes to the FontDescription class.

>>First, I changed the class definition by adding an inst var.  I
>>noticed the class did not show up in my new package.  Looking around,
>>I found a menu option Class...Move definition to package..., so I
>>used that and it allowed me to choose my new package, and the class
>>showed up as expected in the new package.  I then added some new
>>methods, which showed up, bolded, in the new package.  Finally, I
>>modified an existing method, #initialize, which remained unbolded
>>in the new package.  I found a right-button menu option to move
>>this to the new package, so I tried that.  It then appeared bolded
>>in my new package.

>>Here are my questions:
>>1. Generally, is this the "right" way to organize base class changes?
>>2. When I look at FontDescription in the Graphics-Fonts package, it
>>   is now unbolded.  Also, the initialize-release protocol, which only
>>   contains #initialize, is unbolded.  Does this mean that the class
>>   and the #initialize method are no longer a part of the Graphics-Fonts
>>   package or merely that a different version (in my new package) is
>>   loaded?
>>3. If the former, is there a way to add just the new definition to the
>>   new package, leaving the old package untouched?
>>4. Adding to 2 and 3, the package browser now shows the Graphics-Fonts
>>   package and its containers with a +, indicating that they extend
>>   other packages.  Shouldn't they have a -, indicating that they
>>   contain classes extended by my package?
>>5. Is there more detailed documentation on StORE somewhere (other than
>>   the VisualWorks Application Developer's Guide)?  Quite frankly I
>>   was unable to follow the discussion of overrides in the Change List
>>   chapter.

>>TIA for any help!

>>-Christopher



Tue, 13 Apr 2004 23:25:08 GMT  
 right way to override class/method defs in StORE
thanks, that was the info I was looking for.

-Christopher

Quote:

> I typically create a separate package for that (See VRUIPainterPreReq2
> for an example).  As to how I get them there, after I override a method,
> I move it to the new package.


> > A shorter question, if you prefer: if you are using StORE, where
> > do you put your base class changes (not just extensions), and
> > how?

> > -Christopher



Wed, 14 Apr 2004 01:15:07 GMT  
 right way to override class/method defs in StORE
It turns out that there's a better way that I wasn't aware of.  In the
class pane, seelct 'Extend Class or Namespace'.  Now enter the class or
namespace to extend, and it will appear (with no overrides or extensions
yet) in your package.  To reverse that, select the class or namespace
and use the menu option 'Remove Empty Classes and Namespaces'.  That
will push out any classes/namespaces that you didn't extend/override.
Quote:

> thanks, that was the info I was looking for.

> -Christopher


>>I typically create a separate package for that (See VRUIPainterPreReq2
>>for an example).  As to how I get them there, after I override a method,
>>I move it to the new package.


>>>A shorter question, if you prefer: if you are using StORE, where
>>>do you put your base class changes (not just extensions), and
>>>how?

>>>-Christopher



Wed, 14 Apr 2004 01:22:57 GMT  
 right way to override class/method defs in StORE

Quote:
>I typically create a separate package for that (See VRUIPainterPreReq2
>for an example).  As to how I get them there, after I override a method,
>I move it to the new package.

I've been wondering about this, too. Everytime I change a method from a
'standard' package (one supplied by Cincom) I do "move to package.." and it's
stored fine within StORE. However, I noticed that 'real overrides' turn up in
red (and it is rumoured that if you remove these 'red' methods, the original
pops back?), and mine usually don't. What am I doing/expecting wrong?

--

GnuPG 1024D/E0989E8B 0016 F679 F38D 5946 4ECD  1986 F303 937F E098 9E8B



Wed, 14 Apr 2004 00:04:15 GMT  
 right way to override class/method defs in StORE
Actually if it ain't red then it ain't an override in that particular image. If you 'move to package ...' then you do just that,
move the method from the 'standard' package into your package. It will become an override if you publish the package, take a fresh
image (where the method still is in the 'standard' package) and then load the package where you've moved the method, the process of
loading will result in an override for this method in your package.
Better way to create an override was mentioned here already. Select the package where you want the override to go, if the class
isn't listed in the package yet then choose Class>>'Extend Class or Namespace ...'. Then select the class and the method that you
want to override, modify the method and accept. You should get a dialog asking if you want to 'Override' or 'Replace'.
To remove an override you can't just 'remove', because 'remove' removes the method from the system. If you want to remove just the
override, select Package>Browse>'overrides of others'. You'll get a change list showing the original versions of all methods
overriden in that package. To restore the original method just 'Replay' it from that change list. That will remove the override from
your package and reinstate the one in the 'standard' package.

HTH,

Martin


Quote:

> >I typically create a separate package for that (See VRUIPainterPreReq2
> >for an example).  As to how I get them there, after I override a method,
> >I move it to the new package.

> I've been wondering about this, too. Everytime I change a method from a
> 'standard' package (one supplied by Cincom) I do "move to package.." and it's
> stored fine within StORE. However, I noticed that 'real overrides' turn up in
> red (and it is rumoured that if you remove these 'red' methods, the original
> pops back?), and mine usually don't. What am I doing/expecting wrong?

> --

> GnuPG 1024D/E0989E8B 0016 F679 F38D 5946 4ECD  1986 F303 937F E098 9E8B



Fri, 16 Apr 2004 22:13:37 GMT  
 right way to override class/method defs in StORE

Quote:
>Better way to create an override was mentioned here already. Select the package where you want the override to go, if the class
>isn't listed in the package yet then choose Class>>'Extend Class or Namespace ...'. Then select the class and the method that you
>want to override, modify the method and accept. You should get a dialog asking if you want to 'Override' or 'Replace'.

Thanks for the explanation. It does require a bit more planning than I'm used
to (usually, I just hack my way through the system until it does what I want
and then move everything to my 'override package'. The way VW works is
probably telling me that it's time to get some discipline ;-)).

--

GnuPG 1024D/E0989E8B 0016 F679 F38D 5946 4ECD  1986 F303 937F E098 9E8B



Sat, 17 Apr 2004 01:11:52 GMT  
 right way to override class/method defs in StORE
I tried this once, and got a UE when I tried to accept changes
to a class definition.  Unfortunately I didn't pursue the problem,
and now I can't recreate it.  This method works exactly as
has been described.  If I see the exception again, though, I'll post
it.

-Christopher

Quote:

> It turns out that there's a better way that I wasn't aware of.  In the
> class pane, seelct 'Extend Class or Namespace'.  Now enter the class or
> namespace to extend, and it will appear (with no overrides or extensions
> yet) in your package.  To reverse that, select the class or namespace
> and use the menu option 'Remove Empty Classes and Namespaces'.  That
> will push out any classes/namespaces that you didn't extend/override.


> > thanks, that was the info I was looking for.

> > -Christopher


> >>I typically create a separate package for that (See VRUIPainterPreReq2
> >>for an example).  As to how I get them there, after I override a method,
> >>I move it to the new package.


> >>>A shorter question, if you prefer: if you are using StORE, where
> >>>do you put your base class changes (not just extensions), and
> >>>how?

> >>>-Christopher



Sat, 17 Apr 2004 03:01:24 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. sleeping, calling methods inside class defs

2. newbie help needed factoring methods and params in class defs

3. Overriding methods in inherited classes

4. Overriding all methods in a class

5. Overriding methods in classes that use property()

6. overriding of methods and variables in a class.

7. VW: Parcels, StORE, and methods in other classes

8. Storing images in a class methods

9. Trapping method defs

10. accessing a instance method from a class method

11. Method override framework

12. How do I call a method from another method within the same class

 

 
Powered by phpBB® Forum Software