Page 1 of 1

Best practice for huge forms

Posted: Friday 25th February 2022 8:48am
by Witchi
If you develop some huge forms with more and more components, how do you handle that beast? Actually I would split such things into smaller views and use MVC (Model-View-Controller) or MVP (Model-View-Presenter) to get smaller classes. So I have built some panels within the graphical builder of Gambas and then I have re-coded them manually into the view classes and removed them again from the builder. So I can use smaller view and controller classes which handle the events from parts of the whole form only. But this is a lot of stupid work.

I have searched in this forum for MVC and MVP, but no hits. How do you handle that? Stick all event handlers together within form.class and have a huge class per form? Or do you define some Observers for parts of the components in several classes to split the event handler code and leave form.class almost empty? If you use the event handler menu item in the IDE, the handler will always be generated into form.class. But this will result in a god class. What seems to be a good alternative practice?

Re: Best practice for huge forms

Posted: Friday 25th February 2022 10:13am
by AMUR-WOLF
Share please a sample project with only one huge form made in builder and event handlers made via menu in builder. I will try to split it.