posted on Wednesday, July 16, 2003 9:09 PM by admin

Solution Design (Class Structure)

This really isn't a tip, more of a peeve I have. I hate when I pick up someone elses solution and find that there are multiple classes contained in one code file. It is uterly annoying and difficult to find things. I suggest creating a seperate file for each class and name you code files the same as your class definitions. Additionally, create a file structure which corresponds with your namespace definitions.

Tip: If you happen upon a solution where you're having a tough time finding things use the Visual Studio.NET's object explorer:

  1. Hit Ctrl+Alt+J, this will open up the solution in the object explorer.
  2. Now you have a treeview look at your project's namespaces
  3. Drill down to a class and select it
  4. In the right pane right-click on a method name and click "Go to Definition" and you're magically taken to the projects class to the line where that method is defined.

Now for some feedback from you:

Question:  In a logical 3-tier solution how do you define you project hierarchy? Do you keep everything in one project, do you have multiple projects and if so how do you name them. Do you have a well defined folder hierarchy within each project etc. I'll release my hierarchy I typically use after I see what others use. Oh, and why do you choose the way you do it? Is it something you learned or something you developed?

Comments