Should I organize my folders by business domain or by technical domain?

Posted by Florian Margaine on Programmers See other posts from Programmers or by Florian Margaine
Published on 2012-10-18T08:09:02Z Indexed on 2012/10/18 11:14 UTC
Read the original article Hit count: 418

Filed under:

For example, if I'm using some MVC-like architecture, which folder structure should I use:

domain1/
    controller
    model
    view
domain2/
    controller
    model
    view

Or:

controllers/
    domain1
    domain2
models/
    domain1
    domain2
views/
    domain1
    domain2

I deliberately left out file extensions to keep this question language-agnostic.

Personally, I'd prefer to separate by business domain (gut feeling), but I see that most/many frameworks separate by technical domain. Why whould I choose one over the other?

© Programmers or respective owner

Related posts about architecture