[vwnc] Question regarding overrides..

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] Question regarding overrides..

Rick Flower
Hi all..

I'm working on porting some Magritte add-ons over to VW and have the  
code in VW already and
find that I've got a few overrides I need to apply to various system  
classes (Object, ArrayedCollection,etc)..

Anyway, I'm having some problems getting the overrides to be part of  
the package I want.. Below are the
steps I'm using to do the overrides :

1) Copy class definition for Object class (for example)
2) Select the package I want the overrides to reside in (Magritte-
CustomBuilder-Extensions).
3) Paste Object class definition into the source pane and save source.
4) VW asks if I want to replace or override this class definition
5) I select "override" and it goes and highlights every other package  
that has overrides for the Object class
     (now, my initial package class is no longer highlighted in the  
browsers left pane)
6) If I now create the new method for the Object class and save it, it  
shows up in another package
     (in this case Magritte-RealMemento-Extensions instead).

Is there a way to get this Object class override back into my selected  
package again?

Thx!

-- Rick

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Question regarding overrides..

Joachim Geidel
Rick,

Do you really want to override the class definitions, e.g. to add more
instance variables? Overriding the class definition is not necessary if you
just want to override a method or add a new method to a class. Also, an
override for a class definition may be in a different package than overrides
of methods of the same class. I am not sure, but your description sounds as
if you actually wanted to extend a class by adding a new method, and not to
override the class definition or a method (i.e. replace the method by a new
one). Did I get this right? You wouldn't need overrides for that, but a
class extension: Select the class, choose "Extend in package..." from the
class list menu, select the target package from the dialog. Select the
package in the browser's package list, select the new class extension in
this package, and add the method.

Also, if a method ends up in the wrong package, you can always move it to
another one, even if it is a method override (menu entry "Move >> to
package..." in the method list pane of the browser).

Cheers,
Joachim

Am 08.08.08 19:46 schrieb Richard E. Flower:

> Hi all..
>
> I'm working on porting some Magritte add-ons over to VW and have the
> code in VW already and
> find that I've got a few overrides I need to apply to various system
> classes (Object, ArrayedCollection,etc)..
>
> Anyway, I'm having some problems getting the overrides to be part of
> the package I want.. Below are the
> steps I'm using to do the overrides :
>
> 1) Copy class definition for Object class (for example)
> 2) Select the package I want the overrides to reside in (Magritte-
> CustomBuilder-Extensions).
> 3) Paste Object class definition into the source pane and save source.
> 4) VW asks if I want to replace or override this class definition
> 5) I select "override" and it goes and highlights every other package
> that has overrides for the Object class
>      (now, my initial package class is no longer highlighted in the
> browsers left pane)
> 6) If I now create the new method for the Object class and save it, it
> shows up in another package
>      (in this case Magritte-RealMemento-Extensions instead).
>
> Is there a way to get this Object class override back into my selected
> package again?
>
> Thx!
>
> -- Rick
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Question regarding overrides..

Rick Flower
Joachim --

You're correct.. I was just adding a method or two to a few system wide
classes.. I guess I just assumed i needed overrides -- even though I was
extending the classes not replacing methods..  Thanks for the  
clarification
and guidance!

-- Rick

On Aug 8, 2008, at 11:43 PM, Joachim Geidel wrote:

> Rick,
>
> Do you really want to override the class definitions, e.g. to add more
> instance variables? Overriding the class definition is not necessary  
> if you
> just want to override a method or add a new method to a class. Also,  
> an
> override for a class definition may be in a different package than  
> overrides
> of methods of the same class. I am not sure, but your description  
> sounds as
> if you actually wanted to extend a class by adding a new method, and  
> not to
> override the class definition or a method (i.e. replace the method  
> by a new
> one). Did I get this right? You wouldn't need overrides for that,  
> but a
> class extension: Select the class, choose "Extend in package..."  
> from the
> class list menu, select the target package from the dialog. Select the
> package in the browser's package list, select the new class  
> extension in
> this package, and add the method.
>
> Also, if a method ends up in the wrong package, you can always move  
> it to
> another one, even if it is a method override (menu entry "Move >> to
> package..." in the method list pane of the browser).
>
> Cheers,
> Joachim
>
> Am 08.08.08 19:46 schrieb Richard E. Flower:
>
>> Hi all..
>>
>> I'm working on porting some Magritte add-ons over to VW and have the
>> code in VW already and
>> find that I've got a few overrides I need to apply to various system
>> classes (Object, ArrayedCollection,etc)..
>>
>> Anyway, I'm having some problems getting the overrides to be part of
>> the package I want.. Below are the
>> steps I'm using to do the overrides :
>>
>> 1) Copy class definition for Object class (for example)
>> 2) Select the package I want the overrides to reside in (Magritte-
>> CustomBuilder-Extensions).
>> 3) Paste Object class definition into the source pane and save  
>> source.
>> 4) VW asks if I want to replace or override this class definition
>> 5) I select "override" and it goes and highlights every other package
>> that has overrides for the Object class
>>     (now, my initial package class is no longer highlighted in the
>> browsers left pane)
>> 6) If I now create the new method for the Object class and save it,  
>> it
>> shows up in another package
>>     (in this case Magritte-RealMemento-Extensions instead).
>>
>> Is there a way to get this Object class override back into my  
>> selected
>> package again?
>>
>> Thx!
>>
>> -- Rick
>>
>> _______________________________________________
>> vwnc mailing list
>> [hidden email]
>> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc