Re: DOM Level 3 comments

"Martin v. Loewis" wrote:
> Use of enum typedefs. Level 3 uses typedefs like
> 
> typedef enum _DocumentOrder {
>                       DOCUMENT_ORDER_PRECEDING,
>                       DOCUMENT_ORDER_FOLLOWING,
>                       DOCUMENT_ORDER_SAME,
>                       DOCUMENT_ORDER_UNORDERED
>                     };
>                  DocumentOrder;
> 
> I don't know whether these typedefs are deprecated as anonymous types
> in CORBA 2.4.1 (probably they are not), however, I cannot see
> rationale for the two names of the type (_DocumentOrder and DocumentOrder).
> (In addition, the semicolon is superfluous).
> 
> Instead, why not simply write
> 
> enum DocumentOrder {
>                       DOCUMENT_ORDER_PRECEDING,
>                       DOCUMENT_ORDER_FOLLOWING,
>                       DOCUMENT_ORDER_SAME,
>                       DOCUMENT_ORDER_UNORDERED
>                     };
> 
> In a CORBA sense, that creates an alias typecode, which is a real
> overhead in some applications. The only rationale I can find is that
> in C, you'd rather write DocumentOrder instead of "enum
> DocumentOrder".

Fixed the enum as you recommended.

> To me, DocumentOrder.DOCUMENT_ORDER_PRECEDING is much cleaner than
> writing Node3.DOCUMENT_ORDER_PRECEDING; it is immaterial whether Node3
> is a separate interface or not.

We considered this solution but we didn't see enough reason to change
the current proposal. Note that the current DOM C bindings are not
following the OMG IDL mapping (they tried but it was overkilled. there is
an email on this in the archives).

Philippe

Received on Tuesday, 20 March 2001 15:53:04 UTC