how to avoid DRY

Feb 27 2013 4:52 PM
i have a scenario as follow:

public class A : class B
{
public SomeMethodA()
{
//.... do some logics here
SomeMethodB();
}
private SomeMethodB()
{
//.... do some logics here
}
}
class B : class C
class X : class Y
{
public SomeMethodA()
{
//.... do some logics here
SomeMethodB();
}
private SomeMethodB()
{
//.... do some logics here
}
}
class Y : class Z

class A has the exact same method as class X does. Now the question is: How do I combine this method in centralised so that my code has DRY (don't repeat yourself) without modifying/touching class Y, Z and class B, C? Class B, C, Y, and Z are our legacy code and we are NOT trying to alter/modify these classes.
any thoughts?

Answers (1)