I have an interface:
Interface I
{
void Update();
}
and 2 classes that implement it, A & B. Also both of the classes use the same exact function in update but B uses different code later on:
Public class A : I
{
public void Update()
{
someFunc();
}
}
Public class B : I
{
public void Update().
{
someFunc();
....some B code...
}
}
So I thought move someFunc() to A and let B inherit from A since B does what A does plus something else. Is this design ok because it feels not..or can you advise for something better?
I would like to Leave the interface just like in strategy design pattern since later on there can arrive class C that will implement I interface compelitely differently than A and B.