Future-proofing your URL
One way of achieving perennial consistency is to design future-proof URLs. For example, if we're building a social network where every user must belong to an organization, we can identify a user with a URL structure similar to /orgs/<org-id>/users/<user-id>. But if we think ahead, there may be a time in the future where our platform needs to cater for users belonging to multiple organizations; in that case, the URL structure we proposed would not support this.
Therefore, we should design our URL to simply include the user's ID (that is, /users/<user-id>). Then, to associate a user with an organization, we can implement the concept of membership, and structure the membership URL to have the structure /orgs/<org-id>/members/<member-id> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access