Hi Chris:

No, I don't think it's /wrong/ per se, but the way restlet routing
works is "greedy" or something.
I don't understand it that well...I just know that when I did the same
thing you did, I also had the same problem too.
It just seems like when you pass URIs with more than one or two
segments to router.attach() it doesn't do what you think it should.
Probably has something to with matching the correct route when the
request comes in.
Maybe Jerome or Thierry can chime in with a more authoritative
explanation, sorry...

And yes, keep the resources separate because they probably have
different /representations/.
I don't know anything about your system, but I imagine that what you
return about whether a license is valid or not is going to be
different than what you'll return about the usage of a license. Each
aspect of the nouns you work with should probably be modeled with a
different resource in order to handle that aspect.

Jason

On Tue, Nov 22, 2011 at 10:13 AM, Chris Markle <[email protected]> wrote:
> Jason,
>
>> Break it up using more than one Router, and include a filter for
>> whether a license actually exists. [...]
>
> Thanks for the suggestion and the sample code...
>
>>        router.setDefaultMatchingMode(Template.MODE_STARTS_WITH);
>>        router.attach("/licenses/{license}/valid", 
>> LicensesValidResource.class);
>>        router.attach("/licenses/{license}/usage", 
>> LicensesUsageResource.class);
>
> Is the way I did it (which isn't working) just _wrong_ or is it that it's ok 
> but there's a "better" way? I do think that the way I coded it makes 
> optical/intuitive sense at least the the first-timer like me...
>
>> It's more RESTful to keep the resources for license validity and
>> license usage separate as you wrote them.
>
> You're saying here that having the two resources LicensesValidResource and 
> LicensesUsageResource is the better way to go right?
>
> Chris
>



-- 
907-360-1405

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2884434

Reply via email to