A solution, to avoid manipulating too complex structure, could be to use a Facade pattern. That is, for example: add the interfaces IScreenElement_Text_Area_Form
, IScreenElement_Text_Area_Table
and IScreenElement_Text_Area_Calendar
.
Have ScreenElement_Text_Area
implement those 3 interfaces, but only use the most relevant interface in a given context.
That way, a form will only manipulate a ScreenElement_Text_Area
through an IScreenElement_Text_Area_Form
, so it will only be able to access getFormElement()
, but not the other two methods.
That being said, it's just one possible solution. You could also, for example, want to have a look at composition over inheritance.