Object Alias

The logicalTypeName() element is used to provide a unique alias for the domain service’s class name.

This value is used internally to generate a string representation of an service identity (the Oid). This can appear in several contexts, including:

Example

For example:

@Named("orders.OrderMenu")
@DomainService
public class OrderMenu {
    ...
}

Precedence

The rules of precedence are:

  1. `@Named

  2. @DomainService#logicalTypeName

  3. getId() method, if defined

  4. The fully qualified class name.

This might be obvious, but to make explicit: we recommend that you always specify an object type for your domain services.

Otherwise, if you refactor your code (change class name or move package), then any externally held references to the OID of the service will break. At best this will require a data migration in the database; at worst it could cause external clients accessing data through the Restful Objects viewer to break.

If the object type is not unique across all domain classes then the framework will fail-fast and fail to boot. An error message will be printed in the log to help you determine which classes have duplicate object tyoes.