Create a superclass from multiple classes that have common members [closed]
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
开发者_开发百科 Improve this questionI've had this a number of times now. In longer running software projects two or three classes are totally different at the outset. However, as time goes by requirements change, users get a bit smarter, on rare occasions I even get a bit smarter and two seemingly different processes turn out to be very similar. As a consequence, code needs to be modified and these two or three classes end up looking too similar for comfort. They're just screaming to be inherited from a common superclass.
Now I'm an innate lazy guy (reason why I'm making software in the first place) and I'd love to have a tool that does the merging into a superclass for me. With Resharper I can create a superclass from one type.
Does anyone know of a tool that can do this trick with multiple classes, or otherwise some kind of comparison tool that presents commonalities between a number of classes?
There is no tool I know of that can take two or more classes and simply define commonalities.
The closest I have seen in refactoring tools would only operate on a single class and still require input from a programmer.
This is a complex thing to do automatically, so in my opinion a programmer is the best tool...
精彩评论