Refactoring a derived C # class with method dependencies
I want to get your opinion on this.
I have a class that is derived from a base class. I have no control over the code in the base class and it is very important to the system I get from it.
In my class, I inherited two methods that are system critical and are used in almost all functions many times.
I intend to refactor this derived class and extract some classes from it - this won't be a problem. I'm not sure if it's worth fetching the class if I have to constantly translate callbacks into my main class to access two methods (or public wrapper methods) ???
thanks
a source to share
Not sure in your case, but refactoring for you and others. You must weigh the cost of preserving refactoring. The point of method retrieval (not copy and location) is that it centralizes it and makes it easier to deploy changes. So it's probably worth it to have code everywhere.
a source to share
Based on your concerns about dependencies, it looks like you should probably let the "main class" still be the "front door" for the moment - that is, the class that everyone calls. Let the main class delegate to the allocated classes, not vice versa. Without any details, this is all I can think of.
a source to share