Loading ...
Sorry, an error occurred while loading the content.

Re: [soapbuilders] Re: Sparse array interoperability

Expand Messages
  • Paul Kulchenko
    Hi, Hiroshi! ... 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
    Message 1 of 60 , Sep 3, 2001
    • 0 Attachment
      Hi, Hiroshi!

      > 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
      correct.

      > 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.
      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.

      > > 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
      > 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
      array for sparse array, I need to have different representations for
      them in my language, because I will not scan arrays for nulls and in
      fact it may not help, because sparse array may have nulls itself. If
      I CAN echo usual for sparse array, I'm ok with that. Thanks.

      Best wishes, Paul.

      --- nahi@... wrote:
      > 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
      > different arrayType.
      >
      > Regards,
      > // NaHi
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > -----------------------------------------------------------------
      > This group is a forum for builders of SOAP implementations to
      > discuss implementation and interoperability issues. Please stay
      > on-topic.
      >
      > To unsubscribe from this group, send an email to:
      > soapbuilders-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      >


      __________________________________________________
      Do You Yahoo!?
      Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
      http://im.yahoo.com
    • NAKAMURA, Hiroshi
      Hi Paul, ... In SOAP4R; Using low level API, user application gets an instance of SOAPArray class in either case of usual array/sparse array. Using high level
      Message 60 of 60 , Sep 4, 2001
      • 0 Attachment
        Hi Paul,

        > From: Paul Kulchenko [mailto:paulclinger@...]
        > 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
        > correct.

        In SOAP4R;

        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 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.

        > 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.

        In SOAP4R, SOAP node knows whether it is an usual array or
        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
        same 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
        > > 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

        In SOAP data model level, we know we cannot define how we
        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?

        Options:
        http://groups.yahoo.com/group/soapbuilders/message/5128

        Regards,
        // NaHi

        PS. I'm sorry if I'm blunt because of my poor English...
      Your message has been successfully submitted and would be delivered to recipients shortly.