comp.lang.ada
 help / color / mirror / Atom feed
* Any type, any type at all!
@ 2002-07-12 18:23 chris.danx
  2002-07-13 23:04 ` chris.danx
  0 siblings, 1 reply; 3+ messages in thread
From: chris.danx @ 2002-07-12 18:23 UTC (permalink / raw)


Hi,

I've been reading through the proposed DOM Level 3 spec and was wondering
how an implementation could handle some of the new requirements for core
compliance.  In particular the DOMUserData type (section 1.1.7)

To quote:

>  Type Definition
>
>  A DOMUserData represents a reference to an application object.

It can't be generic can it?  That would mean you couldn't mix types within
the DOM, which is from my interpretation, the intention of this type.

I can think of one way involving (access to) classes, which makes it a tad
ugly for simple types like Integers, Strings, etc, but to me it seems the
only way.  Any thoughts on how to handle this in Ada (from someone more
experienced)?


Regards,
Chris





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Any type, any type at all!
  2002-07-12 18:23 Any type, any type at all! chris.danx
@ 2002-07-13 23:04 ` chris.danx
  2002-07-13 23:15   ` Jim Rogers
  0 siblings, 1 reply; 3+ messages in thread
From: chris.danx @ 2002-07-13 23:04 UTC (permalink / raw)


> I've been reading through the proposed DOM Level 3 spec and was wondering
> how an implementation could handle some of the new requirements for core
> compliance.  In particular the DOMUserData type (section 1.1.7)
>
> To quote:
>
> >  Type Definition
> >
> >  A DOMUserData represents a reference to an application object.
>
> It can't be generic can it?  That would mean you couldn't mix types within
> the DOM, which is from my interpretation, the intention of this type.
>
> I can think of one way involving (access to) classes, which makes it a tad
> ugly for simple types like Integers, Strings, etc, but to me it seems the
> only way.  Any thoughts on how to handle this in Ada (from someone more
> experienced)?

No comments?





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Any type, any type at all!
  2002-07-13 23:04 ` chris.danx
@ 2002-07-13 23:15   ` Jim Rogers
  0 siblings, 0 replies; 3+ messages in thread
From: Jim Rogers @ 2002-07-13 23:15 UTC (permalink / raw)


chris.danx wrote:

>>I've been reading through the proposed DOM Level 3 spec and was wondering
>>how an implementation could handle some of the new requirements for core
>>compliance.  In particular the DOMUserData type (section 1.1.7)
>>
>>To quote:
>>
>>
>>> Type Definition
>>>
>>> A DOMUserData represents a reference to an application object.
>>>
>>It can't be generic can it?  That would mean you couldn't mix types within
>>the DOM, which is from my interpretation, the intention of this type.
>>
>>I can think of one way involving (access to) classes, which makes it a tad
>>ugly for simple types like Integers, Strings, etc, but to me it seems the
>>only way.  Any thoughts on how to handle this in Ada (from someone more
>>experienced)?
>>
> 
> No comments?


I'll try a comment. I hope it is on-topic.

The definition of a DOMUserData specifies a reference to an object.
My suspicion is that many languages will have difficulty with such
a definition.

In C you would make a DOMUserData a void pointer. You would then be
stuck with figuring out what was really pointed to.

In Java you would use an Object reference. You would then need to
wrap primitive types in their corresponding wrapper classes. This
could cause some problems on the receiving end if the language reading
the XML data was not Java.

In Ada you could create an abstract tagged type as the base type for
all DOMUserData. You would then need to create a subtype of that
abstract type to contain each actual data representation. Again, this
would cause some problems when decoding or reading the DOMUserData by
some other language.

C# would have the easiest time representing the DOMUserData because
even primitive types inherit from Object. Again, you will have a
problem if the language reading the XML data is not C#.

Unless consistent format for DOMUserData is defined similar to
the definitions for CORBA, you will have inter-language interpretation
issues.

Jim Rogers






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-07-13 23:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-12 18:23 Any type, any type at all! chris.danx
2002-07-13 23:04 ` chris.danx
2002-07-13 23:15   ` Jim Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox