views:

36

answers:

1

How do you typically organize Windows Application project files and what naming guidelines you follow?

For example, usually I keep project root folder as clean as possible with program.cs, app.config. All the others files are put into project folders:

UI folder for all UI components:

  • UI\Base (base forms and base user controls)
  • UI\Controls (all kind of user controls grouped by functionality)
  • UI\Forms (all kind of forms grouped by functionality)

Exceptions folder for UI exceptions hierarchy

Model folder for application specific UI-related classes (Domain Model classes are in separate library):

  • Model/Presentation (classes that wrap domain model POCO classes to use with UI controls, often override ToString method for listboxes, comboboxes datagrids & so on)
  • Model/Configuration (classes that represent configuration file structure)
  • Model/Data (classes for user control complex initialization)

there are also project folders that depend on concrete project requirements.

+3  A: 

I would advise breaking your UI into one project and your business logic and model into another project altogether.

As far as file/folder structure, what you mentioned seems reasonable.

EDIT for clarity: when I said model, I meant domain model. If you have presenters a-la the MVP pattern, that makes sense to be in the UI project. Things like your entities should be in another project.

Andy_Vulhop
My model (domain model, classes that returned and send to DAL) is separate library, but business logic combined with application. What is bad to keep business logic combined?
Andrew Florko
Now I know postfix for Model/Presentation classes. I called them decorators but presenters more appropriate :)
Andrew Florko
You could decouple the UI from the business logic that way. The business logic is not the concern of your UI, so it should know as little about it as possible. It allows you to enforce separation of concerns more directly. You also gain a lot of flexibility in that you can alter your biz logic without touching the UI project.
Andy_Vulhop
Thank you, I'll take a look at MVP pattern more closely.
Andrew Florko