How to properly structure a project in winform?

Posted by user850010 on Programmers See other posts from Programmers or by user850010
Published on 2012-04-14T07:39:28Z Indexed on 2012/04/14 11:44 UTC
Read the original article Hit count: 274

A while ago I started to create a winform application and at that time it was small and I did not give any thought of how to structure the project.

Since then I added additional features as I needed and the project folder is getting bigger and bigger and now I think it is time to structure the project in some way, but I am not sure what is the proper way, so I have few questions.

How to properly restructure the project folder?

At the moment I am thinking of something like this:

  • Create Folder for Forms
  • Create Folder for Utility classes
  • Create Folder for Classes that contain only data

What is the naming convention when adding classes?

Should I also rename classes so that their functionality can be identified by just looking at their name? For example renaming all forms classes, so that their name ends with Form. Or is this not necessary if special folders for them are created?

What to do, so that not all the code for main form ends up in Form1.cs

Another problem I encountered is that as the main form is getting more massive with each feature I add, the code file (Form1.cs) is getting really big. I have for example a TabControl and each tab has bunch of controls and all the code ended up in Form1.cs. How to avoid this?

Also, Do you know any articles or books that deal with these problems?

© Programmers or respective owner

Related posts about .NET

Related posts about visual-studio