classinheritanceumlclass-designecb-pattern

UML - Can subclass of a Boundary acts as controller?


I'm wondering if a subclass of a Boundary acts as a controller ?


Solution

  • Subclassing means inheritance. That is the subclass inherits from the superclass. In that respect the subclass is still whatever the superclass is. But since it's something new it may as well inherit anything else. So it may inherit from a controller class as well making it a hybrid. Whether that is meaningful depends of course. The MVC paradigm aims towards separating boundaries1 (views) from controllers. Uniting them once again is just working counter that paradigm.

    1I'm used to MVC. See Model View Controller vs Boundary Control Entity