On Thu, Jul 22, 2010 at 21:44, Justin Edelson <[email protected]> wrote:
> On 7/22/10 3:17 PM, Tony Giaccone wrote:
>> <order>
>> <name>Bob Smith</name>
>> <accountNumber>12345</accountNumber>
>> <lineItems>
>> <lineItem id=1>
>> <qty>1</qty>
>> <desc>Widget</desc>
>> <price>1.99</price>
>> <lineTotal>1.99</price>
>> </lineItem>
>> <lineItem id=2>
>> <qty>2</qty>
>> <desc>Bar</desc>
>> <price>2.00</price>
>> <lineTotal>4.00</price>
>> </lineItem>
>> </lineItems>
>> </order>
>>
>>
> I would treat this as four nodes:
>
> /orders/{orderID} - the order
> /orders/{orderID}/lineItems - a sling:OrderableFolder
> /orders/{orderID}/lineItems/1 - the first item
> /orders/{orderID}/lineItems/2 - the second item
>From a "nice paths/URLs" content model perspective, I would give them
readable names. In this example using the description for example,
using :nameHint = description.
/orders/{orderID} - the order
/orders/{orderID}/items - a sling:OrderableFolder
/orders/{orderID}/items/widget
/orders/{orderID}/items/bar
/orders/{orderID}/items/bar_1
:nameHint will ensure a unique name in case of duplicates. Also using
shorter names like "items" instead of "lineItems" has its advantages
(shorter URLs, more easily readable, etc.).
Just my 2 cents...
Alex
--
Alexander Klimetschek
[email protected]