Re: Sparse array interoperability
- Hi Paul,
--- In soapbuilders@y..., Paul Kulchenko <paulclinger@y...> wrote:
> Sparse arrays are different. They are "arrays" because they are
> indexed by numbers, but (for me) they are not interoperable with
> usual arrays, aren't they?
I do not think so. If sparse array is not interoperable
with usual array, it does not have to be an array.
Hash/Map is a possibly good solution it this like you said
in another message.
We sometimes want the array including indeterminate elements
(such as VARIANT ARRAY with many Empty in COM, array with
many undef-s in Perl). We can reduce transmitted data
using Sparse array to pass these type of array. I believe
SOAP authors introduce Sparse array for this purpose.
> It's very similar to difference between multidimensional arrays and
> arrays of arrays. Will you accept array of arrays as echo for
> multidimensional array?
I disagree here. Common array and Sparse array have same
type of content (arrayType). 1D-Array and 2D-Array have
- Hi Paul,
> From: Paul Kulchenko [mailto:paulclinger@...]In SOAP4R;
> Sent: Tuesday, September 04, 2001 9:13 AM
> > I do not think so. If sparse array is not interoperable
> > with usual array, it does not have to be an array.
> If this is correct then question is "how"? How usual array should
> look like in this case? In my current implementation, sparse array is
> the same as array with undef/null elements, but I'm not sure it's
Using low level API, user application gets an instance of
SOAPArray class in either case of usual array/sparse array.
Using high level API, user application gets an instance of
common Array class in Ruby in either case. Sparse array is
the same as usual array with nil elements in high level API.
User application which wants to use sparse array must use
low level API.
So I must build echo interop server using low level API
when the interop echo R2 application adopts Option 5.
> > We sometimes want the array including indeterminate elementsIn SOAP4R, SOAP node knows whether it is an usual array or
> > (such as VARIANT ARRAY with many Empty in COM, array with
> > many undef-s in Perl). We can reduce transmitted data
> > using Sparse array to pass these type of array. I believe
> > SOAP authors introduce Sparse array for this purpose.
> how implementation should look like in this case? Would you scan
> EVERY array to check how many nulls are there? Would you allow user
> (who doesn't care about it) tell that he want to have "sparse" array
> on wire? It does make sense ONLY if there is already some type in a
> language that implements sparse arrays. But I do not expect SOAP
> processor to be so smart and choose between array and sparse array
> checking number of empty elements.
sparse array. When receiving an array, with "offset" or
"position" attribute, SOAP4R recognize it as a sparse array.
When sending an array, user application must define it as
a sparse array by low level API.
I mean, SOAP4R consider a partial array with "offset" as a
sparse array. It could be an error under lexical context
of SOAP spec, but I think these 2 special arrays is for the
> > > It's very similar to difference between multidimensional arraysIn SOAP data model level, we know we cannot define how we
> > and
> > > arrays of arrays. Will you accept array of arrays as echo for
> > > multidimensional array?
> > I disagree here. Common array and Sparse array have same
> > type of content (arrayType). 1D-Array and 2D-Array have
> > different arrayType.
> That's true. My point was different. They look different on wire, but
> they are the same in some languages (Perl for example). So, you're
> saying that they are indeed different and you do NOT accept one as
> echo for another one. That's similar to my point about sparse arrays.
> Ther MAY look the same as usual array in your language, but they are
> different. Looks like I'm the only one who support this point of view
> Let me summarize. This discussion was started from echoArray problem
> when you send sparse array and I send back usual array where omitted
> elements are nulls. How correct is it? Definitely what I'm sending
> back IS NOT a sparse array. So what? Is it proper echo? Andrew's
> point was that sparse array and array with nulls ARE NOT the same. In
> theory (sorry, Andrew ;)). How about practice? If I CANNOT echo usual
should do, don't we? In the R2 echo application level, we
are discussing how we should do for testing inteoperability
in a most effective way, I think.
Someone like Option 5, someone like Option 1. I can accept
Option 5. Which do you like?
PS. I'm sorry if I'm blunt because of my poor English...