[英]SOA, RPC and interproject dependancies
我對SOA的理解:業務中的各種系統都需要進行安全檢查,因此使用相同的流程並因此具有SecurityCheck服務是有意義的。 然后可以通過多種方式調用該服務-soap,rpc,http請求。
如果到目前為止這是有意義的,那么我的問題是關於服務和rpc客戶端之間的依賴關系的:
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;
}
}
是否應該有3個單獨的項目,其中SecurityCheckService
項目和RpcClient
項目取決於SecurityCheckResults
項目?
我認為,您應該創建2個項目:一個用於SecurityCheckService
,另一個用於RpcClient
。 SecurityCheckResults
是僅用於返回結果的類(與int,double或smth相同)。 您代碼中的SecurityCheckResults
不是很大的類,因此您可以將其與SecurityCheckService
服務的存根一起提供給客戶端。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.