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:
Welcome, my name is Paul Stovell. I live in Brisbane and work on Octopus Deploy, an automated deployment tool.
Prior to founding Octopus Deploy, I worked for an investment bank in London building WPF applications, and before that I worked for Readify, an Australian .NET consulting firm. I also worked on a number of open source projects and was an active user group presenter. I was a Microsoft MVP for WPF from 2006 to 2013.