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

Re: Collections and special cases

Expand Messages
  • risseraka
    ... I m not sure if you mean parallel as in mutualy exclusive or as in combinative . There is a case where a program is looked up by a timestamp with an
    Message 1 of 3 , Jan 24, 2013
    • 0 Attachment
      --- In rest-discuss@yahoogroups.com, Jan Algermissen wrote:
      >
      >
      > On 14.01.2013, at 11:10, "risseraka" wrote:
      > > Whereas my personal preference goes for the first solution, my guts get a bit fuzzy with trying to get a single item hitting directly on the collection end-point.
      >
      > Agreed - your scenario is 'indexing' into the collection not a 'sub bucket'. You could, of course, argue about this a lot - here are two things to consider:
      >
      > - do you maybe have more filters that work in parallel? This makes the first solution obviously better.

      I'm not sure if you mean parallel as in "mutualy exclusive" or as in "combinative".

      There is a case where a program is looked up by a timestamp with an "at" parameter.
      If "current" and "at" parameters are used together, "current" will take precedence over "at" and redirect accordingly to the current program.

      I have pondered on solutions like /programs?at=1359000000 and /programs?at=now but am not convinced.

      > - Implementation-wise the first solution is usually cleaner, because {id} will always denote an ID in your code, no special if(id == "live") needed.

      Indeed, if(id == "live") is a pain whereas if(query.current) is much smoother.

      > >
      > > In both cases a 302 Moved Temporarily is performed(?) to redirect to the live program's URI, /programs/1234 with "1234" being the current program's id.
      >
      > Yes, makes sense.
      >
      >
      > Jan

      Adrien.
    Your message has been successfully submitted and would be delivered to recipients shortly.