I'm trying to refactor old code where I encountered a repetitive pattern when calling the same method inside every single method of a class:
public class Client(){
public void GetOne(int a, int b)
{
CreateSomething(a, b);
....
}
}
public void GetTwo(int a, int b)
{
CreateSomething(a, b);
....
}
}
public void GetThree(int a, int b)
{
CreateSomething(a, b);
....
}
}
}
As a requirement, the constructor(s) cannot be changed, and I would really like to clean this up.
I read a bit about AOP, I'm not used to it. Do you think it's a good patern to use it in this case? Is there any other simpler alternative.
Thank's