[vtkusers] Too many virtual declaration in vtkCallbackCommand version 1.7.

David Cole david.cole at kitware.com
Thu Jan 5 15:11:06 EST 2006


Other virtual declarations are not meaningless... They allow for a 
client program to subclass this object and override the behavior of 
those methods. Personally, I'd rather see a C++ library like VTK (meant 
for further subclassing and use by other programmers) err on the side of 
providing slightly too many virtual methods than not quite enough. I 
absolutely hate it when I go to override a method in a library class and 
discover that it's not declared virtual.

Did this change to vtkCallbackCommand actually cause a problem for you? 
If you have a valid reason for not having virtual methods in that class, 
you could always write your own version of it based on a prior revision 
of vtkCallbackCommand... Fortunately, there's not that much code in that 
class.

Just my two cents,
David

derong wrote:

> Does anyone take a look at the recent change of vtkCallbackCommand?
> From my point of view, only Execute(...) needs virtual(comes from 
> superclass), other virtual declarations are meaningless and not good.
>  
>  
> Dennis
>  
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>  
>



More information about the vtkusers mailing list