技术开发 频道

Rose实例:构造银行业务模型(4)

    实施模型(Implementation Models)

    实施模型   

    设计过程环境

    实施组件图

    

    实施文件(Implementation Files): TellerGUI.exe, BankApp.exe, BankDB.exe

    组件接口选择:

    1) BankApp具有单接口 IbankApp,其所有操作都是公有的(exposed)

    2) BankApp暴露(exposes) IBankApp, ICheckingAccount, & ISavingAccount 接口

    3) BankApp暴露(exposes) IBankApp, IWithdraw, IDeposit, ICheckingAccount, & ISavingAccount 接口

    CORBA IDL/C++ 需要对接口进行描述

    Rose 组件图:在浏览器窗口,选择Component View;,将"Main"重命名为"Component View";双击图名显示该图;在图上放置组件和依赖关系(从client组件到supplier组件拖曳);在浏览器中把每个类拖到相应的组件中;选择Tools-Check Model;选择File-Save.

    实施部署图

    

    Rose 部署图:在浏览器窗口选择Deployment View;双击以显示该图;在图上放置节点和关系;选择Tools-Check Model;选择File-Save.

    //使用CORBA的 BankApp系统的接口

   

//Sample IDL Interface Code(IDL 接口代码样本)
module BankApp {
interface IBankApp {
  exception exInsuffientFunds;
  IBankApp getApp();
  boolean depositToCheckingAccount (in string sAcctNum, in int nDeposit)  ;
  boolean depositToSavingAccount (in string sAcctNum, in int nDeposit)  ;
  boolean withdrawFromCheckingAccount (in string sAcctNum, in int nWithdraw)raises
(exInsuffientFunds);
  boolean withdrawFromSavingAccount (in string sAcctNum, in int nWithdraw) raises
(exInsuffientFunds);
};};
//Sample Java Interface Code Using Remote Method Invocation
//(使用RMI 的Java接口样本)
import java.rmi.*;
package BankApp;
public interface IBankApp extends java.rmi.Remote {
boolean depositToCheckingAccount (String sAcctNum, int nDeposit) throws
java.rmi.RemoteException ;
boolean depositToSavingAccount (String sAcctNum, int nDeposit) throws
java.rmi.RemoteException ;
boolean withdrawFromCheckingAccount (String sAcctNum, int nWithdraw) throws
java.rmi.RemoteException;
boolean withdrawFromSavingAccount (String sAcctNum, int nWithdraw) throws
java.rmi.RemoteException;
}
//Sample Microsoft IDL Interface Code for COM - Simplified
//(Microsoft IDL 的COM接口编码样本-简化版)
library BankAppLib {
dispinterface IBankApp {
IBankApp getApp();
boolean depositToCheckingAccount (BSTR sAcctNum, int nDeposit) ;
boolean depositToSavingAccount (BSTR sAcctNum, int nDeposit) ;
boolean withdrawFromCheckingAccount (BSTR sAcctNum, int nWithdraw);
boolean withdrawFromSavingAccount (BSTR sAcctNum, int nWithdraw);
};
coclass BankApp {
dispinterface IBankApp;
}; };
//Sample SOAP (Simple Object Access Protocol) SDL (Service Description Language)
with XML -Incomplete
//包含XML 的SOAP SDL样本-不完全
<?xml version='1.0'?>
<serviceDescription name='BankApp'
xmlns='urn:schemas-xmlsoap-org:sdl.2000-01-25'
xmlns:dt='http://www.w3.org/1999/XMLSchema'
xmlns:IBankApp='IBankApp'>
<import namespace='IBankApp' location='#IBankApp'/>
<soap xmlns='urn:schemas-xmlsoap-org:soap-sdl-2000-01-25'>
<interface name='IBankApp'>
<requestResponse name='WithdrawFromCheckingAccount'>
<request ref='IBankApp:WithdrawFromCheckingAccount'/>
<response ref='IBankApp:WithdrawFromCheckingAccountResponse'/>
</requestResponse>
</interface>
<service>
<addresses>
<address uri='http://myserver/IBankApp.asp'/>
</addresses>
<implements name='IBankApp'/>
</service>
</soap>
<IBankApp:schema id='IBankApp' targetNamespace='IBankApp'
xmlns='http://www.w3.org/1999/XMLSchema'>
<element name='WithdrawFromCheckingAccount'>
</element>
<element name='WithdrawFromCheckingAccountResponse'>
<type>
<element name='return' type='dt:boolean'/>
</type>
</element>
</IBankApp:schema>
</serviceDescription>
 

0
相关文章