One definition of abstraction is hiding the implementation details and the one I am using for this question.
I read the question and many answers for using abstract
in Java (Abstract class in Java). However, if we can define the functionality we want in subclasses from an abstract class, this seems to also contain the opposite of abstraction.
That is, by writing an abstract class we are exposing the implementation details.
If we look at the point of view from with in the implementing class, the only hidden implementation details provided by abstract class are
final public void finalMethod()
and
public void implementedMethod() // considering we do not override it.
However:
abstract public void abstractMethod();
seems to do the opposite of abstraction, as now we are in fact forced to implement this method, i.e. expose the implementation details.
What is the opposite of abstraction?
One answer is concretization as see here in "What’s the opposite of abstraction?" on Software Engineering.
The refined question is can an abstract class provide both abstraction and concretization?
It appears to do both.