当前位置: 技术问答>java相关
什么情况下,我们该使用Local接口呢?
来源: 互联网 发布时间:2015-10-28
本文导语: 所谓local client是不是同一个容器里的ejb呢? 如果不需要ejb调用ejb,是否就不需要local接口 感觉local接口只是为了本地优化,不一定有的吧 | It depends on if your system is distributed. If your archit...
所谓local client是不是同一个容器里的ejb呢?
如果不需要ejb调用ejb,是否就不需要local接口
感觉local接口只是为了本地优化,不一定有的吧
如果不需要ejb调用ejb,是否就不需要local接口
感觉local接口只是为了本地优化,不一定有的吧
|
It depends on if your system is distributed.
If your architecture is as following, taking Remote Interface:
UI Tier.
.
.
Business Interface
.
.(RMI/IIOP)
EJB Tier
In this case, you take RMI/IIOP as the protocal as EJB components might located on different JVMs. Even in this case, you could develop two kinds sub architecures, one is for the middle-distributed system, that is: All EJB are located on the SAME JVM, you could take Session Facade. And UI tier is located on the other JVM. The other is for the large-scaled distributed sytem, EJBs are located on the different JVMs, you got no chioce but use remote interface.
If your architecure is non-distributed system, then all EJB tiers(Session Bean as EJB service entry and Entity Bean as domain model) could be Local. You could take Proxy pattern or business delegate to implement the business interfaces. In this case, you could displace the EJB tier with whatever you like as O/R mapping, JDO or JDBC.
local与remote应该是区分应该是:是否在容器中调用,如果你不想同你的ejbContainer以外的信息通信,那么就用local,如果需要通讯那么就用remote.
我一般是entityBean是local,sessionBean是Remote.
If your architecture is as following, taking Remote Interface:
UI Tier.
.
.
Business Interface
.
.(RMI/IIOP)
EJB Tier
In this case, you take RMI/IIOP as the protocal as EJB components might located on different JVMs. Even in this case, you could develop two kinds sub architecures, one is for the middle-distributed system, that is: All EJB are located on the SAME JVM, you could take Session Facade. And UI tier is located on the other JVM. The other is for the large-scaled distributed sytem, EJBs are located on the different JVMs, you got no chioce but use remote interface.
If your architecure is non-distributed system, then all EJB tiers(Session Bean as EJB service entry and Entity Bean as domain model) could be Local. You could take Proxy pattern or business delegate to implement the business interfaces. In this case, you could displace the EJB tier with whatever you like as O/R mapping, JDO or JDBC.
local与remote应该是区分应该是:是否在容器中调用,如果你不想同你的ejbContainer以外的信息通信,那么就用local,如果需要通讯那么就用remote.
我一般是entityBean是local,sessionBean是Remote.