Singleton resources
In this application, we will refer to resources as objects that are related to the URI contained in the API server. This means that to manage the /products
URI we are going to have a ProductResource
object that will manage the CRUD operations for this URI.
We will create this object as a singleton to guarantee that we have just one object managing each URI in our application. For more information on singleton, refer to http://en.wikipedia.org/wiki/Singleton_pattern.