Conventions are not always good. I recently started a new internal web project at Codurance and I decided to use Scala. As I'm not a fan of big frameworks, I chose Scalatra as a micro web framework.
The first challenge was that I wanted to organise my application with a different directory structure. By default, sbt and Scalatra use the same convention used by maven:
> /src/main/scala // source code
> /src/main/resources // production resources
> /scr/test/scala // tests
> /scr/test/resouces // test resources
For the past few years I've been experimenting with different directory structure for my projects. I want my directories to be more meaningful when it comes to explain the business domain. The new directory structure is part of what I call Interaction Driven Design (IDD) and a full talk on it can be found in our videos area. I give a lot of details about the rational behind the new directory structure on that talk.
The directory structure I would like to use for this new project is:
> /src/core/scala // source code for my core domain
> /src/core-test/scala // tests for my core domain
> /src/data/resources // resources for data migration and test data
> /src/data/scala // code for data migration and test data
> /src/web/resources // delivery mechanism resources
> /src/web/scala // delivery mechanism code (controllers, API, etc)
> /src/web-test/scala // tests for my delivery mechanism