Modeling resource relationships with RESTful APIs

Viewed 3527

When designing a RESTful API should resources which are dependent on others be modeled as sub-uris or should they simply reference each other?

E.g. presuming a door is always dependent on a house then

/house/73/door/1

or

/house/73
/door/1044

where house and door include references to each other?

Most RESTful APIs I have found are quite flat so I would value references to any which do have more complex relationship dependencies.

Regards

2 Answers
Related