For example, I have define AssetA and AssetB which are both inherit from
Asset. So I may access to AssetA by /Asset/A/{id} and AssetB by
/Asset/B/{id}. In this case I need to define AssetAResource and
AssetBResource.

Now other developer wanted to introduce another customized Asset, says
AssetC inherits Asset, so a AssetCResource is defined and assuming that user
should be able to access to AssetC by /Asset/C/{id}, how can I assure that
when AssetC is added, I do not need to attach the uriPattern /Asset/C/{id}
to the router manually. 


Thierry Boileau wrote:
> 
> Hello limss,
> 
> so, you are aware the world of resources and domain objects are not the 
> same. Good point.
> Just a few words on how to design your REST interface. You must define 
> the resource you want to expose, give them name (URIs), define the 
> methods (let's say HTTP methods : GET, PUT, DELETE, POST) you want to 
> apply on them, the kind of representations you want to exchange with them.
> Having said that, what do you mean by "User are allowed to add on any 
> new ObjectA3" ? Which resource is called? Is there a "container" resource?
> 
> Best regards,
> Thierry Boileau
> 
>> Currently I have a few objects (ObjectA1, ObjectA2) that are inherit from
>> parent class ObjectA. User are allowed to add on any new ObjectA3 as long
>> as
>> they are inherited from ObjectA.
>>
>> May I know what would be the best way to define the URL pattern as well
>> as
>> Resource so that when new Objects added in, I do not need to add in the
>> new
>> binding to the Router ?
>>
> 
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1233165
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Generic-URI-pattern-and-Resource-tp2388390p2393178.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

Reply via email to