Best Practice many forms

DoJa

Active member
Joined
Mar 23, 2014
Messages
33
Programming Experience
1-3
Hey all,

I wrote an application about 3 years ago which has been an on-going work in progress but I have now decided to re-write it from the ground up to put right all the mistakes I made along the way. I was hoping I could get some advice from some more experienced programmers in the community to help me make fewer mistakes and faux pas in this edition so I end up with something which is faster, more efficient and secure.

Whilst I would welcome any generalist suggestions relating to the concept above, I will try to steer the conversation with a little more detail to keep the whole thing on topic.

Q1. My UI shares similarities with an iphone/pad type app or self service supermarket checkout eg. lot's of different screens/views with minimal information on each one and big buttons, rather than cramming everything into a single window.

It was previously suggested that my method of using a different form for each of these views was inefficient/inadvisable. Currently I have about 20 forms in the old/existing version, and to add all the functionality I have planned this could easily double to nearer 40. Is it true that I should not be using forms in this way and if so what would be the recommended alternative?
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,137
Location
Sydney, Australia
Programming Experience
10+
While it's certainly feasible and not necessarily inadvisable to put more into a single Windows Form than you might on a single page in a mobile app, you still shouldn't try to cram loads in one form. The Single Responsibility Principle should extend to forms too. In some cases, that single responsibility might be to aggregate data from multiple other single sources but such combinations should be cohesive. The perfect balance is something that will differ from person to person and application to application but, as a general rule, less is more.
 

DoJa

Active member
Joined
Mar 23, 2014
Messages
33
Programming Experience
1-3
I understand the logic of the single responsibility principle. However I think that could by achieved by keeping the bulk of the functionality outside of the form itself and instead within external classes. The question is if there are performance gains to be had from using something like a tab control (or similar) to display 5-10 different pages/views instead of having each one on a separate form.

This is important as it effects how the navigation between pages/views is handled. In the old version I am using a container and MDI child forms to create a navigation bar at the top which does not change and the form beneath it which does. It has worked ok so far but I am considering options if there is a better alternative.
 

rudalboy09

Member
Joined
Nov 27, 2014
Messages
15
Programming Experience
1-3
use mdi form, it will be minimalize your form. or you can use hide and show function into a frame.
 
Top Bottom