Next Previous Up Top Contents Index

4 Writing and Compiling IDL

4.3 Mapping IDL to Dylan

To get an impression of the mapping from IDL to Dylan, we can take a look at the result of applying the mapping to the file bank.idl. The following Dylan definitions are taken from bank-protocol.dylan, part of the Bank-Protocol project produced by compiling bank.idl IDL:

define open abstract class BankingDemo/<account> (<object>)
end class;

define open generic BankingDemo/account/name (object :: BankingDemo/<account>) => (result :: CORBA/<string>);

define open generic BankingDemo/account/balance (object :: BankingDemo/<account>) => (result :: CORBA/<long>);

define open generic BankingDemo/account/credit (object :: BankingDemo/<account>, amount :: CORBA/<unsigned-long>) => ();

define sealed class BankingDemo/account/<refusal> (CORBA/<user-exception>) slot BankingDemo/account/refusal/reason :: CORBA/<string>, required-init-keyword: reason:; end class;

define open generic BankingDemo/account/debit (object :: BankingDemo/<account>, amount :: CORBA/<long>) => ();

define open abstract class BankingDemo/<checkingAccount> (BankingDemo/<account>) end class;

define open generic BankingDemo/checkingAccount/limit (object :: BankingDemo/<checkingAccount>) => (result :: CORBA/<long>);

define open abstract class BankingDemo/<bank> (<object>) end class;

define open generic BankingDemo/bank/name (object :: BankingDemo/<bank>) => (result :: CORBA/<string>);

define sealed class BankingDemo/bank/<duplicateAccount> (CORBA/<user-exception>) end class;

...

To provide some more intuition for the mapping scheme, the following subsections examine the Dylan counterparts of some of the more representative IDL declarations from the file bank.idl. See Appendix A, "An IDL Binding for Dylan" for the full mapping description.

4.3.1 - Mapping for interfaces
4.3.2 - Mapping for basic types
4.3.3 - Mapping for attributes
4.3.4 - Mapping for operations
4.3.5 - Mapping for exceptions

Developing Component Software with CORBA - 26 May 1999

Next Previous Up Top Contents Index