Horizontal vs. Vertical Project Structure
When creating new projects, especially when using new technologies or patterns, it's common to start with a very horizontal or layer-based folder structure:
As the project evolves artifacts are added to each folder. Over time, I find this structure becomes hard to work with:
- When editing a view and needing to find the view model, there's a lot of scrolling involved
- If I decide to split an area of functionality into a different assembly, it's not so easy to track down the files I need
- I'm much more likely to need to edit all of the "change address" artifacts than I am to edit all of the "view model" artifacts in a single unit of work.
My preference is to structure projects vertically by feature, using a folder per feature: