Polling. The Controller periodically asks the Service for the latest data. IMHO, this option sucks, but it's certainly possible. Callbacks. The Controller registers a callback object ("observer") with theService. The Service invokes a method on
首先,准备service接口,两个 public interface AccountService { public void createAccount(Account account, int throwExpFlag) throws Exception; public void createAccountShell(Account account, int i) throws Exception; } public interface RoleService { public void c