RAFCON icon indicating copy to clipboard operation
RAFCON copied to clipboard

Let tabs inherit from ExtendedController

Open franzlst opened this issue 4 years ago • 1 comments

Currently, both the StateMachinesEditorController and the StatesEditorController create the tabs themselves and keep them up to date. With increasing information in the tabs, this blows up the code in those controllers, in addition, it violates the single responsibility principle.

Therefore, I think tabs should become ExtendedControllers themselves and thus observe and react to their desired models.

Originally created by @franzlst ([email protected]) at 2017-11-22 09:05:21+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst

I also thought about this kind of solution while fixing issue #424 and refactoring the StateMachinesEditorController. What I don't like about this design is, that the controller would adapt/change elements which are not part of the StateMachineEditor- or StateEditor-Controller view attribute because the tab label is a part of the notebook class or better of the page in the notebook. Thereby a clean implementation would create a new Hierarchy in the controller structure and would hold the NoteBookPage view.

So basically you are talking about a State- or StateMachine-NoteBookPageController which both will be strongly different.

I would at this point also discuss the option to create a utils NoteBookController as a utils class which integrates the duplicated and abstract interfaces StatesEditor- and StateMachines-EditorController are implementing so that both can inherit from those class. This will reduce the cascade and number of generated controller from my point of view.

Originally created by @Rbelder at 2017-11-22 11:08:39+00:00 (moved from RMC internal repository)

franzlst avatar Apr 17 '20 10:04 franzlst