WebAPI - What should be the Developer's mind set

A common misnomer today with Web APIs is that each resource must map to an entity or business object backed by a database. Often, this will come up in a design conversation where someone might say, “We can’t have that resource because it will require us to create a table in the database and we have no real need for a table.” The previous definition described a mapping to one or more entities; this is an entity in the general sense of the word (i.e., it could be anything), not a business object. An application may be designed such that the resources exposed always map to business entities or tables, and in such a system the previous statement would be true. However, that is a constraint imposed by an application or framework, not the Web.

When you are building Web APIs, there are many cases where the entity/resource constraint is problematic. For example, an order processing resource actually orchestrates different systems to process an order. In this case, the resource implementation invokes various parts of the system that may themselves store state in a database. It may even store some of its own state, or not. The point is there is not a direct database correspondence for that resource. Also, there is no requirement that the orchestrated components use a database either (though in this case they do).

Keep this distinction in mind as you go forward in your Web API design.

To view or add a comment, sign in

More articles by Shine Velayudhan

  • The Mikado Method Introduction (extract)

    The Mikado Method is a structured way to make significant changes to complex code. How many times have you tried to fix…

  • Content Delivery Pattern for Cloud (CDN)

    This pattern focuses on reducing network latency for commonly accessed files through globally distributed edge caching.…

  • Microservices Design Pattern

    Functional decomposition of an application with the help of DDD (Domain Driven Design) is a prerequisite for building a…

    8 Comments
  • Finally I'm just ready to take new challenges!!! Are you ready?

    Finally I'm just ready to take new challenges!!! Are you ready? This time with Dot Net Framework Core 1.0.

  • Architecture based on the publisher/subscriber pattern and Repository Pattern

    Patterns Publisher/Subscriber pattern. Repository pattern.

  • Is software architecture important?

    Is software architecture important? Software architecture then, is it important? The agile and software craftsmanship…

  • Favorite quote

    “The most beautiful and profound emotion we can experience is the sensation of the mystical. It is the sower of all…

  • My way of working

    "I'm a slaves who obey in everything those who are my earthly masters, not by way of eye-service, as people pleases…

Explore content categories