On Fri, May 14, 2010 at 3:58 PM, Martin Atkins <
ma...@degeneration.co.uk> wrote:
>
> Hi Tatu,
>
> On 05/14/2010 03:40 PM, Tatu Saloranta wrote:
>>
>> Quick question on JSON definition
>> (
http://activitystrea.ms/head/json-activity.html): it looks like
>> location of 'generator' entry differs between text and (non-normative,
>> I know) sample.
>> In text it is claimed to belong in 'Activity', but in sample within
>> main stream item. To me latter makes more sense, for what that is
>> worth. But it would be good to resolve this.
>
> The generator feature (along with a new "service provider" property designed
> at StreamCamp) still needs work in the spec. What we have there right now is
> really just a placeholder for it.
Ok.
> Thanks for pointing out that it's inconsistently placed, though. The main
> thing that motivates the decision about whether something like this belongs
> at the activity level or not is whether we expect it to be carried over when
> something is favorited or otherwise taken out of context of its activity. In
> this case, I think you're right that generator belongs at the object level
> because the generator of a thing is a property of that thing.
>
> To be concrete, generator is expected to be used to represent the client
> application or platform application that generated the item. So in the case
> of Twitter, you might find "TweetDeck" in here as you do in Twitter's own
> API.
Right, that's what I thought. And in my case the whole feed is created
by something I have implemented, and same for all contained activity
entries.
...
> Since JSON lacks any formal extension mechanism I'd suggest that if you are
> adding truly private things that are only of interest between you and your
> specific consumers just invent names that are unlikely to conflict with
> other things added in future, perhaps by prefixing them with your product
> name.
XML does not have any formal extension mechanism itself (Schemas do
provide some of that) so I don't think that is a problem (sure, there
are mechanisms like namespaces [and even basic attribute/element
distinction] that make it somewhat easier to logically divide data --
this is where JSON has issues)
But what I was thinking was more mentioning whether additional
properties are allowed or not (sounds like they are?); and this could
differ between object types.
For example, maybe generator object is thought of as extensible
object, whereas others might not be.
It sounds however that idea is that any object is assumed extensible:
so use of a prefix seems a practical solution.
> If you think that what you're designing might be useful to others then you
> might consider writing a spec or even just a short proposal and throwing it
> out for comment; if you actually document the names you've used in a way
> that others can see it then it's less likely that there will be collisions.
Sure. My needs are quite simple; basically I am exposing chunks of
logical stream (pagination, kind of), but in addition to activities
contained there are also ones that may be filtered out. As such I just
want to pass additional activity id to indicate "head" of stream (last
entry that was skipped and not included in response); which can be
passed back to avoid having to re-read significant portions of
in-memory stream for next result chunk.
I am just starting implementation so I will make sure to ask more
questions & suggest things once I find them.
I like specification updates so far -- JSON spec is now much more
useful, esp. due to sample document.
-+ Tatu +-