[英]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. 我对SOA的理解:业务中的各种系统都需要进行安全检查,因此使用相同的流程并因此具有SecurityCheck服务是有意义的。 The service could then be called in a variety of ways - soap, rpc, http request.
然后可以通过多种方式调用该服务-soap,rpc,http请求。
If this makes sense so far then my question is with regards to the dependencies between the service and rpc client: 如果到目前为止这是有意义的,那么我的问题是关于服务和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;
}
}
Should there be 3 seperate projects, where the SecurityCheckService
project and the RpcClient
project depend on SecurityCheckResults
project? 是否应该有3个单独的项目,其中
SecurityCheckService
项目和RpcClient
项目取决于SecurityCheckResults
项目?
In my opinion, you should create 2 projects: one for SecurityCheckService
and another for RpcClient
. 我认为,您应该创建2个项目:一个用于
SecurityCheckService
,另一个用于RpcClient
。 SecurityCheckResults
is only class for returning results(the same as int, double or smth else). SecurityCheckResults
是仅用于返回结果的类(与int,double或smth相同)。 SecurityCheckResults
in your code isn't very large class, so you can provide it to clients together with stubs of SecurityCheckService
service. 您代码中的
SecurityCheckResults
不是很大的类,因此您可以将其与SecurityCheckService
服务的存根一起提供给客户端。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.