I just started programming with objects recently and am trying to learn good habits early on.
The way I plan to structure my application is to have two files:
1: Program.cs – This file will contain the main logic for the application
2: Class.cs – This file will contain all of the class definitions
Pretty simple. What I’m wondering if I should have any more files for … well, you tell me.
Any help would be appreciated.
It’s generally accepted that each Class should have it’s own file.
I am assuming when you say this that you mean that the main class is in this file. (The class with the entry point to the application). The various parts of the logic should be separated out and placed in the classes that make the most sense to have them.
Links to object oriented design:
http://www.csharphelp.com/2006/05/designing-object-oriented-programs-in-c/
http://www.informit.com/articles/article.aspx?p=101373
Links to namespaces:
http://www.csharphelp.com/2006/02/namespaces-in-c/
http://msdn.microsoft.com/en-us/library/dfb3cx8s.aspx