Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Let's also answer another question, "Why do we use the word resource?" The answer is because our method for referencing a resource, i.e., a URL, stands for Uniform Resource Locator. Since we are building web APIs that rely upon the standards for URIs (or URL) and the standards for HTTP, we want to use the terms already employed.

The HTTP standards state indicate that "a resource could be anything". The URI standards tell us that the term "is used in a general sense for whatever might be identified by a URI". While these might not seem overly helpful, they really are important because they caution us against preconceived notions of what a resource is or is not.

In our practical answer above, there is a warning about tightly binding resources to database tables. Resources can be abstractions of anything meaningful. They are often aggregates of digital information pulled from multiple sources (which is why one-to-one relationships between resources and tables is discouraged). OpenInsight developers already have some experience with this concept: Calculated Columns. A calculated column provides a way for tables to draw information from other sources, such as other OpenInsight thus providing the client with richer data than is physically stored in a specific database table. One resource returned by a URI can be a combination of different database rows from different tables, OS files such as images and PDFs, or even data stored in other database technologiesdata pulled from another technology like SQL. To the client this is just a resource and it has no knowledge of the underlying ways the server manages the source content.