简体   繁体   中英

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 remoteService;

    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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM