View Issue Details
|Fixed in Version
|0000022: Separate Responsibilities of the Controller
The Controller class has too many responsibilities and it would be desirable to separate these responsibilities into separate classes:
1., Configuration Management (configHandler): inject the configHandler singleton whereever it is needed and try to remove/extract those parts of the code that have Feature Envy (e.g. when configHandler is used in connection with TopicMessageTypeConfig):
2., Kafka Service Layer: e.g. Number of Runnables executed by runInDaemonThread need only singletons like consumerHandlers injected, but probably do not need to be part of the JavaFx Controller
3., EventHandlers passed as parameter in setOnAction can be very likely extracted. Be aware that these EventHandlers will also benefit from 1., and 2.,
I will give prio high to this issue, since it can dramatically increase the speed of future develepmoent tasks.
|No tags attached.
Please check my "cleanercode" branch for possible way, how the refactoring could look like. I introduced the concept of the BackgroundRunnable and extracted TopicsForCluster as an example. At the end of the day the BackGroundTaskHolder will probably turn into some kind of BackgroundTaskManager taking this responsibility completely from the Controller. Please give me feedback to this approach. (unfortunately this commit contains a little refactoring from the develop branch, too, sorry)
In order to have the ability to split the Controller class, it could be very helpful to have the KafkaesqueAdminClient injectable. Therefore I continued development on my cleanercode branch. Please check my latest changes as well: https://github.com/grofoli/KafkaEsque/commit/169b1d503b55768cff21afe62fe47d8796f61e4f