override non-static method with a static one

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

I have a base class with all abstract methods. I need to inherit from this
base class but the new class will have all static methods. Is there a way to
do this?

I tried using new but then it complains that the base method hasn't been
implemented.

Thanks,
Joe
 
Joe said:
I have a base class with all abstract methods. I need to inherit from this
base class but the new class will have all static methods. Is there a way to
do this?

No. You could override the abstract method with something which just
calls a static method though.
 
Abstract base classes are just like interfces, so if u derive from it ,
first u should do is to implement all virtual functions of abstract class.

Then u can use the these virtual functions by creating an instance of your
new class, if u want to use the static methods, just call them using the
your class (no need to use new-no need to create an instance-)
 
I already have one class that implements the base class. This other class is
a static wrapper to call the implementation class. The implementation is
actually a remote object. Now you're probably wondering why do this all over
again instead of just using code generated from soapsuds. Well the reason is
because I need to do some additional work before making the actual call to
the server.

I'll mess around and report back on how I ended up.

Thanks,
Joe
 
Back
Top