开发者

SOA, RPC and interproject dependancies

My understanding of SOA: Various systems in a business need to do security checks, so it makes sense to use the same process and therefore have a SecurityCheck service. The service could then be called in a variety of ways - soap, rpc, http request.

If this makes sense so far then my question is with regards to the dependencies between the service and rpc client:

public interface SecurityCheckService {
    public SecurityCheckResults check(String name);
}

public class SecurityCheckResults {
    private Date instant;
    private int score;
    //getter & setters
}

public class RpcClient {
    private SecurityCheckService rem开发者_如何学JAVAoteService;

    public boolean check(int personId) {
        String name = "Person" + personId;
        int score = remoteService.check(name).getScore();
        return score > 10;
    }
}

Should there be 3 seperate projects, where the SecurityCheckService project and the RpcClient project depend on SecurityCheckResults project?


In my opinion, you should create 2 projects: one for SecurityCheckService and another for RpcClient. SecurityCheckResults is only class for returning results(the same as int, double or smth else). SecurityCheckResults in your code isn't very large class, so you can provide it to clients together with stubs of SecurityCheckService service.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜