Organizing classes
You will notice that the hallmark of a clean project is that it will have well-organized classes and that folders will be used to group classes that belong together. Furthermore, the classes in the folders will be enclosed within namespaces that match the assembly name and folder structure.
Each interface, class, struct, and enum should have its own source file in the correct namespace. Source files should be logically grouped in the appropriate folders and the namespaces for the source files should match the assembly name and folder structure. The following screenshot demonstrates a clean folder and file structure for a WPF project:
Figure 3.1: Clean folder structure
Figure 3.1 displays the file and folder structure for a Visual Studio C# solution that is clean in its organization. Folders are named correctly, and only classes with the relevant functionality are placed in those folders. This makes code easier to locate and maintain...