Fork me on GitHub

How to register domain services, repositories and factories

Domain services (which includes repositories and factories) can either be automatically registered (by virtue of being present on the classpath and annotated appropriately) or must be explicitly registered in the configuration file, under the key (a comma-separated list).

Automatic Registration

Automatic registration of services requires that the service be annotated with the @DomainService annotation (in org.apache.isis.applib.annotations package); for example:

package com.mycompany.myapp.dom.customer;
import org.apache.isis.applib.annotation.DomainService

public class Customers {

Isis must also be configured to enable automatic registration of doman services; add the following to

Also, the package prefix (comma separated) for all domain services must be specified; for example:

Isis will then discover all @DomainService-annotated services and automatically register them.

Explicit Registration

Domain services can also be explicitly registered, again in, by updating the key. For example: = com.mycompany.myapp.employee.Employees\,

If all services reside under a common package, then the can specify this prefix: = com.mycompany.myapp = employee.Employees,\

This is quite rare, however; you will often want to use default implementations of domain services that are provided by the framework and so will not reside under this prefix.

Examples of framework-provided services (as defined in the applib) can be found referenced from the main documentation page and also the services page.