Best practice for huge forms

New to Gambas? Post your questions here. No question is too silly or too simple.
Post Reply
Witchi
Posts: 11
Joined: Monday 14th February 2022 6:27pm
Location: Germany

Best practice for huge forms

Post 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?
User avatar
AMUR-WOLF
Posts: 21
Joined: Sunday 6th February 2022 8:41am
Location: Russia

Re: Best practice for huge forms

Post 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.
Post Reply