-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: remove CREATE PRIVATE/PUBLIC when ABSTRACT #293
Comments
This would only be relevant when the class is also (Also, relevant issue from the past: #104 ) |
Hi PhiL, as mentioned by ConjuringCoffee, CREATE PUBLIC would still make sense for an abstract non-final class, because this information is then inherited by its subclasses:
By contrast, for an ABSTRACT FINAL class, no constructor can be declared anywhere, so as far as I can see, you're right that CREATE {PUBLIC|PROTECTED|PRIVATE} could be removed in such a case. I could just imagine this to be a hint in the sense of "for now, we'll prevent instantiation of this class, but if we ever change our minds and remove the FINAL, we then want the class to be CREATE PUBLIC" (but that may be a bit far-fetched…) Therefore, not entirely sure what to do with this. One argument that came up in a different place is that unfortunately, ABAP classes are by default CREATE PUBLIC (while CREATE PRIVATE would be desirable to enforce static CREATE methods with good, semantic names); therefore, you should keep CREATE PUBLIC in the code as a reminder that the class design is not yet ideal. (But admittedly, that's a different story). Kind regards, |
HI @jmgrassau ,
in my understanding, an abstract class cannot be created.
Therefore we don't need extra definition how it is allowed to be created.
before:
after:
What do you think?
Thanks
PhiL
The text was updated successfully, but these errors were encountered: