Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 1
    Domain is usually the layer containing business logic. Domain is usually also refered to as the layer containing services. Domain objects are not plain POJOs, Domain object should contain business logic such as argument validation and as such. It would probably be better to rename the layer to something else. Repository layer is also quite often used to transfer data from multiple sources to your domain objects. Commented Jul 1, 2016 at 7:24
  • Will the Service and Repository modules be Spring projects as well? Commented Mar 6, 2017 at 17:28
  • 1
    @GlennVanSchil No, it does not have to be Spring projects b/c when the whole project is built, repo/service layer will be included in the classpath. The @Autowire will work as a result. Commented Mar 6, 2017 at 20:04
  • @MinjunYu Thanks for the clear answer! But your repo/service does need spring as maven dependency for the Service, Repository or Component annotations am I right? Commented Mar 7, 2017 at 7:18
  • 1
    @GlennVanSchil If you put all the spring maven dependencies in the pom.xml of the parent module, then there is not need to add any spring related dependencies in child modules (repo/service modules). This is just one way to layout multi modules projects in spring. The purpose is to organize your code. If your project is not that big and will not change in the foreseeable future, you can combine the domain,repo,service in the same module called "core". It looks even cleaner. Commented Mar 7, 2017 at 16:04