|
|
|
[
Permlink
| « Hide
]
Adam Vandenberg - 07 Dec 06 15:57
Or possibly even "add empty virtual method to base class [select base class] and extract to overidden method", though perhaps that's getting too specific.
Or even better offer a "extract factory method"-dialog which slightly differs from the extract method dialog in the following ways:
It suggests a name for the method: namely Create[ReturnTypeName] or Create[NameOfVariableWhichGotAssignedTheReturnValue] and by default use the protected virtual modifiers! Just add "Create virtual method" checkbox, which will switch to "protected" if current setting is "private", and disable "private" choice.
We can also make simple analysis of the body – if extracted body is object creation expression, suggest "factory" names based on return type. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||