Closed rertyy closed 6 months ago
@rertyy i think abstract classes dont have to provide implementations but concrete classes do
@bgopi23 But the interface also doesn't have implementations?
@Li-Zizhen thats the nature of interfaces, but any concrete classes extending it has to
@bgopi23 Got it. Thank you.
The abstract method can be shown:
Hm if that's the case, why is {abstract}
not shown for interface methods? Since by default interface methods are abstract
unless it's a default method
Hm if that's the case, why is
{abstract}
not shown for interface methods? Since by default interface methods areabstract
unless it's a default method
@rertyy <<interface>>
already tells us the methods are abstract. Adding it to every method in the diagram doesn't add value but adds noise. This is the same reason why we don't use the abstract
keyword when defining methods in a Java interface.
But default methods for interfaces exist, and we can't differentiate if implicitly we assume abstract? At least for static there's underline
But default methods for interfaces exist, and we can't differentiate if implicitly we assume abstract? At least for static there's underline
@rertyy Default methods are just a recent quirk introduced into Java. It is more of an implementation detail, not a natural part of what we normally call an 'interface'. UML <<interface>>
is not specific to Java, and models a more general concept of an interface.
If you must include a default method in a class diagram, you can indicate them using some other way e.g., using a custom stereotype <<default>>
in front of the method, or a UML note.
Why does
ProgressWatcher
not have+update(int)
?