- edited description
Refactor: Extract Interface
I’m working on introducing proper service interfaces for my org’s service layer and since some of the current service classes are huge with tens of methods, a Refactor → Extract Interface like in IDEA’s Java feature set would be such a time saver!
I know there are other refactor issues open, but I hadn’t seen Extract Interface mentioned explicitly yet.
Iterations
A first version could just create a new interface class with the signatures of all the public methods of the source class in it, and add an implements <INTERFACE>
to the source class’s class
definition.
Future versions could be fancier, like replacing uses of the implementation class with uses of the interface like in IDEA’s Java Extract Interface feature, or allowing the user to select which public methods to include, but that’s less urgent for me.
Thanks for considering!
Related to:
Comments (4)
-
reporter -
repo owner - changed status to duplicate
Duplicate of #1879.
-
repo owner Please see the linked issue for the original enhancement request for interface extraction.
-
reporter Ah, thanks. I searched on “extract interface” and didn’t find this issue. I guess Bitbucket issues needs to improve their search functionality a bit.
- Log in to comment