DEV Community

FigueroaR
FigueroaR

Posted on

Why I like restful routing

Let us take a walk down memory lane. When we access our thoughts, we do it in an abstract manner. Through a smell, a color, a location we can access many memories, memories from years ago or as recent as a few seconds ago. Our brain is a beautiful thing, but we cannot always control it the way we would want to.

Accessing our memories on demand is a complicated thing. With time our memories tend to lose their detail. While recalling memories under stress we tend to forget what we already know by heart. We do not have a specific method of accessing each memory category. For example, let us say we want to remember a recipe. Its difficult to access a section called” recipes”, in part because that does not exist in out brain. We do not have little folders in our brain referencing each material or type of ideas.

There is a solution, we can save the recipes in a computer, in a nice folder and have other subfolders in it, where we can save different types of recipes. If we have this information on a website, maybe we want to add, create, update, or delete recipes. This is all possible thanks to Thomas Fielding. Mr. Fielding had the wonderful idea called RESTful routing, an idea that dictates a manner to access information via an address that follows a protocol. Example: /recipes/:id/edit. Here we access our recipes, now we need a specific one (:id), then we go an edit it.

It is all 20/20 hindsight, but early websites did not apply RESTful routing, this made it difficult to locate yourself in a website. But with REST routing, it is easier to navigate and even guess what the next address is, we can maybe type it in ourselves and have access (depending on our security logic). This has brought a type of standardization to the industry, one much needed.

Top comments (0)