Example Java code of a User service
package org.foo.user.service;
public class UserService {
/**
* Create a new User
*/
public void create (User user, ResoaResponse response, ResoaGateway gateway) {
// Add your business logic here.
}
/**
* Handle a login request
*/
public void login (User user, ResoaResponse response, ResoaGateway gateway) {
// Add your business logic here.
}
/**
* Log out an user
*/
public void logout (User user, ResoaResponse response, ResoaGateway gateway) {
// Add your business logic here.
}
}
Characteristics of Resoa Services
- A single service is class method with dedicated parameters.
- Services are linked to types, which are designed by XSD (here the User class as first parameter in each method).
The service implementation for a business object is done within one class.
- There is only one naming convention, the service implementation class name must extend
the underlying XSD defined type name by Service (here the UserService class).