Abstract Class
An abstract class is a base class that provides some shared implementation while still leaving some required behavior for subclasses to supply. Unlike an interface, it can carry reusable code and common state along with the contract.
βΆArchitecture Diagram
π StructureDashed line animations indicate the flow direction of data or requests
When several related classes repeat the same fields and the same pre- and post-processing logic, every change has to be copied across them. But collapsing everything into one concrete class removes the places where variation should still be possible.
Object-oriented frameworks and libraries often needed a way to preserve a common flow while letting user code fill in specific steps. Abstract classes became a natural tool for that job because they could combine reusable default behavior with mandatory extension points.
An abstract class can define concrete methods and fields and can also declare abstract methods that subclasses must implement. This lets the base type control the overall flow while delegating specific variations downward.
An abstract class is heavier than an interface but stronger at sharing implementation. The real dividing line is whether shared code is genuinely needed; if not, an interface is usually the cleaner contract.
Abstract classes fit parsers, task runners, UI widget bases, and other families where the overall sequence stays similar but some steps vary. The risk is that as the base class accumulates more responsibility, subclasses become tightly bound to its internals.