Link to the API and services
We spent a lot of time talking about the entity from the point of view of its evolution and not with a data focus, but this is done on purpose because we generally take too much time defining the attributes and not enough thinking about the business entity as a whole, living object. Now that this is done, let’s use the final section of this chapter to come back to the notion of services and API that we have detailed in the previous chapter.
Including time in an API
One of the first consequences of thinking about the entity as a whole, including its history, is that the writing methods on a corresponding API should not work exactly the same. As reading methods, they are similar to the following:
GET on /api/entity
: This is used to read the list of entitiesGET on /api/entity/{id}
: This is used to read a given entity
However, if you want to take action and be able to access history, you should add some methods such as the following...