Does `activator new` create the correct Scala Play

2019-09-14 01:43发布

问题:

According to the Scala Play application layout documentation the anatomy looks as follows:

 app                      → Application sources
  └ assets                → Compiled asset sources
     └ stylesheets        → Typically LESS CSS sources
     └ javascripts        → Typically CoffeeScript sources
  └ controllers           → Application controllers
  └ models                → Application business layer
  └ views

When activator new is issued:

The models directory seems to be omitted:

Discussion:

Some Play examples contain a models directory, while this is not the case when activator new is executed.

回答1:

Yes. The folder app is equivalent to src/main/scala or src/main/java in a traditional Scala or Java project, so what resides under it is developer-defined.

On an aside, SBT now supports Giter8, so you could try generating a project using the Play Scala Seed if you would like to sense-check my answer.