xpcom ,idl 中的数据类型

idl编程,

https://www.omg.org/cgi-bin/doc?formal/02-06-39

 

CMU/SEI-2002-TN-015
27
8.2    IDL
A small sample interface specified in OMG’s IDL is shown in Figure 14. This interface is for 
an element that manages a bank account. The element provides resources to manage a finan-
cial account with attributes of “balance” and “owner.” The operations provided include 
“deposit” and “withdraw.” Although syntax is specified unambiguously in this type of docu-
mentation, semantic information is largely missing. For example, can a user make arbitrary 
withdrawals? Withdrawals only up to the current account balance? Up to a daily limit? Up to a 
minimum balance? If any of these restrictions is true, what happens if it’s violated? Is the max-
imum permissible amount withdrawn, or is the transaction as a whole canceled? 
IDL by itself is inadequate when it comes to fully documenting an interface, primarily because 
IDL offers no language constructs for discussing the semantics of an interface; without expres-
sion of the semantics, ambiguities and misunderstandings will abound.
interface Account { 
readonly attribute string owner; 
readonly attribute float balance; 
void deposit (in float amount); 
void withdraw (in float amount); 
};
interface CheckingAccount: Account { 
readonly attribute float overdraft_limit;
void order_new_checks (); 
};
interface SavingsAccount: Account {
float annual_interest (); 
};
interface Bank { 
CheckingAccount   open_checking   (in   string   name,   in   float
starting_balance); 
SavingsAccount   open_   savings   (in   string   name,   float
starting_balance);
};

https://resources.sei.cmu.edu/library/asset-view.cfm?assetid=5939

https://resources.sei.cmu.edu/asset_files/TechnicalNote/2002_004_001_13973.pdf

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值