Re: Simple Arbitrary Data Exchange
Kevin Smith <[email protected]> Tue, 24 Sep 2019 16:56:47 +0100
| Newsgroups | gmane.network.jabber.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============0908812012== Content-Type: multipart/alternative; boundary="Apple-Mail=_59F0B6B2-E56C-4385-898A-EFA186EAD076" --Apple-Mail=_59F0B6B2-E56C-4385-898A-EFA186EAD076 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 24 Sep 2019, at 16:42, Dave Cridland <[email protected]> wrote: >=20 >=20 >=20 > On Tue, 24 Sep 2019 at 09:30, Kevin Smith <[email protected] = <mailto:[email protected]>> wrote: > On 24 Sep 2019, at 09:20, Dave Cridland <[email protected] = <mailto:[email protected]>> wrote: > >=20 > > Is there interest amongst the developer community to provide a = generalised, interoperable facility for the exchange of simple, = arbitrary data between consenting entities? I'm calling this SADEX, but = I'm really, really, not wed to this name. > >=20 > > The key here would be the API - you'd want to provide the equivalent = of a function call such as: > >=20 > > void sadex_message(JID to, String type, String data) > >=20 > > You'd also need a callback for when you receive some, and perhaps an = IQ form. >=20 > It=E2=80=99d depend how wed you are to exactly what you describe = there. Swiften=E2=80=99s API would make more sense to do = message->setSadexType(=E2=80=A6) and message->setSadexData(), and a = callback wouldn=E2=80=99t make much sense, you=E2=80=99d just = message->getSadexType and message->getSadexData() (or maybe = message->getSadex()->(get|set)(Data|Type)(). Not what you describe, but = still equivalent to how subject/body work in the API, and I don=E2=80=99t = see a problem with adding it. >=20 > I think we're looking at a type (something morally equivalent to an = XML namespace) and payload, and we want to ensure both are set or = neither. I=E2=80=99m assuming you mean ensuring on the send side, rather than = receive? e.g. you=E2=80=99re not anticipating a library auto-errorring = stanzas with one and not the other. > But you're absolutely right that whatever API is used should fit the = existing APIs of the library. >=20 > But ultimately, I'm most interested in a low-friction way of = exchanging application-specific data that will guide people away from = doing worse things. The constraints here would seem to be "easy to use", = "obvious", and probably "in the core/default download=E2=80=9D. I see no problem doing that in Swiften. /K --Apple-Mail=_59F0B6B2-E56C-4385-898A-EFA186EAD076 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">On = 24 Sep 2019, at 16:42, Dave Cridland <<a = href=3D"mailto:[email protected]" class=3D"">[email protected]</a>> = wrote:<br class=3D""><div><blockquote type=3D"cite" class=3D""><br = class=3D"Apple-interchange-newline"><div class=3D""><div dir=3D"ltr" = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: = normal; letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><br = class=3D"Apple-interchange-newline"><br class=3D""><div = class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, 24 = Sep 2019 at 09:30, Kevin Smith <<a = href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>> wrote:<br = class=3D""></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px = 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; = border-left-color: rgb(204, 204, 204); padding-left: 1ex;">On 24 Sep = 2019, at 09:20, Dave Cridland <<a href=3D"mailto:[email protected]" = target=3D"_blank" class=3D"">[email protected]</a>> wrote:<br = class=3D"">><span class=3D"Apple-converted-space"> </span><br = class=3D"">> Is there interest amongst the developer community to = provide a generalised, interoperable facility for the exchange of = simple, arbitrary data between consenting entities? I'm calling this = SADEX, but I'm really, really, not wed to this name.<br = class=3D"">><span class=3D"Apple-converted-space"> </span><br = class=3D"">> The key here would be the API - you'd want to provide = the equivalent of a function call such as:<br class=3D"">><span = class=3D"Apple-converted-space"> </span><br class=3D"">> void = sadex_message(JID to, String type, String data)<br class=3D"">><span = class=3D"Apple-converted-space"> </span><br class=3D"">> You'd = also need a callback for when you receive some, and perhaps an IQ = form.<br class=3D""><br class=3D"">It=E2=80=99d depend how wed you are = to exactly what you describe there. Swiften=E2=80=99s API would make = more sense to do message->setSadexType(=E2=80=A6) and = message->setSadexData(), and a callback wouldn=E2=80=99t make much = sense, you=E2=80=99d just message->getSadexType and = message->getSadexData() (or maybe = message->getSadex()->(get|set)(Data|Type)(). Not what you = describe, but still equivalent to how subject/body work in the API, and = I don=E2=80=99t see a problem with adding it.<br = class=3D""></blockquote><div class=3D""><br class=3D""></div><div = class=3D"">I think we're looking at a type (something morally equivalent = to an XML namespace) and payload, and we want to ensure both are set or = neither.</div></div></div></div></blockquote><div><br = class=3D""></div><div>I=E2=80=99m assuming you mean ensuring on the send = side, rather than receive? e.g. you=E2=80=99re not anticipating a = library auto-errorring stanzas with one and not the other.</div><br = class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div = dir=3D"ltr" style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; = font-size: 12px; font-style: normal; font-variant-caps: normal; = font-weight: normal; letter-spacing: normal; text-align: start; = text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: = none;" class=3D""><div class=3D"gmail_quote"><div class=3D"">But you're = absolutely right that whatever API is used should fit the existing APIs = of the library.</div><div class=3D""><br class=3D""></div><div = class=3D"">But ultimately, I'm most interested in a low-friction way of = exchanging application-specific data that will guide people away from = doing worse things. The constraints here would seem to be "easy to use", = "obvious", and probably "in the core/default = download=E2=80=9D.</div></div></div></div></blockquote><div><br = class=3D""></div>I see no problem doing that in Swiften.</div><div><br = class=3D""></div><div>/K<br class=3D""><br class=3D""></div><div><br = class=3D""></div><br class=3D""></body></html>= --Apple-Mail=_59F0B6B2-E56C-4385-898A-EFA186EAD076-- --===============0908812012== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ JDev mailing list Info: https://mail.jabber.org/mailman/listinfo/jdev Unsubscribe: [email protected] _______________________________________________ --===============0908812012==--