Interfaces, abstract classes and versioning 
Author Message
 Interfaces, abstract classes and versioning

Here's the scenario I need to implement:

Say, I have 2 classes, let's call them C1 and C2. They have
similar functionality but are physically 2 different
objects. In my application, I need to dynamically switch
between the 2 classes.
So, I define an interface (either using __interface or an
__abstract class) that both of these classes inherit. Let's
call this I1. In my application, I have a pointer to I1
that I dynamically move to an object of type C1 or C2.
Every function in the interface is implemented in both
classes (they might not be doing anything). This is all
well and good.

Now, we release this as a dll in Release 1. We need to
continue development on C1 but not C2. How can we do this
safely without killing any code in C2 and the application?
At this point the application can either have a pointer to
I1 or I2....

Here is one option we considered
We release a new interface I2 and C1 implements I2 in
addition to I1. C2 does not implement I2. This does not
seem to be a viable solution because a pointer of type I2
cannot switch between C1 and C2. To use this scenario, we
will have to update C2 when we update C1.

We don't care if the interface is implemented as an
abstract class or an interface, how do we fix this problem?

Thanks a lot for your help

Tue, 22 Feb 2005 07:26:39 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Autogenerating Inherited (abstract class or interfaces) members code

2. abstract base class and interface

3. Abstract classes and interfaces, what the difference?

4. Implementation skeleton for interfaces/abstract classes

5. abstract class versus interface?

6. Abstract classes implementing interfaces

7. Abstract class vs Interface

8. Abstract classes and abstract properties?

9. versioning of interfaces

10. Interface Versioning

11. serializing a class derived from an abstract base class

12. using non dll-interface class as base for dll-interface class


Powered by phpBB® Forum Software