ABAP OO – extract Interface / using SE24 refactoring assistant

A looong time ago, when I was still in school, eclipse was new (and only for Java programming) and a cool thing it could do was “extract interface”: You would code a class, click that button and an interface would be created.

In ABAP, I don’t think, there is such a thing (or is there?). Also, in the past I have not cared much for interfaces, although I kind of know, it’s good to have them (e.g. for making things easy with ABAP unit and also good OO design (“always program against an interface” )).

So I have a class and no interface, but I rather have a class, implementing an interface.
Here is what I do:

1. SE24 create the interface (just name and description)
2. SE24 assign it to my class, activate.
3. Call up utilities-> Refactoring -> Refactoring assistant
4. Drag&drop public methods from the class to the interface.
5. Save + activate.
Done

So how about you?
– did you know the SE24 refactoring assistant?
– is there something similar in AdT?
– don’t you ever need something like that, as always create an interface up front?

best
Joachim

PS: I think this could be a text-only blog, but as I made some screenshots, I’ll share them here:

SE24%20-%20call%20the%20refactoring%20assistant

SE24 – call the refactoring assistant

use the refactoring assistant

SE24%3A%20use%20the%20refactoring%20assistant

SE24: use the refactoring assistant