Can RESTful API be achievable goal?
The idea of REST described by Roy Fielding is well known since mid-aughts. Despite the absence of official REST specification we all know its philosophy and can aplly it to real APIs. But the problem is can we apply it tottaly? Isn’t it unreachable limit of perfection?
Let us consider the Resources and its identifiers first. A resource is an abstract concept. In a REST, any information that can be named may be resource. A resource is a conceptual mapping to a set of entities. The set of entities evolves over time, a resource doesn’t. Resource are identified by uniform resorce identifiers (URIs), which can be particulary URLs. For example, entity can be “User”, which has two states: “logged in” and “logged out”. Therefore, we can construct multiple similar resources: “Logged users”, “Unlogged users”. Speaking in a terms of web API they may have URLs as follows: