Hi,
This is my first post here, so hello everyone!
I'm an API rookie and I've started learning about Web API design with some projects of mine in mind.
I have browsed through the archives looking for some notes useful for a newbie in the API design business.
One of the interesting ones I found is this recommendation [1] by Mike Amundsen
"(...) as long as you design you API as use-case driven (GET /admin-dashboard) and not object-driven (GET /users/) (...)"
I admit, it is not as obvious to as it may seem.
Then, while reading the MuleSoft's "Secrets of a great API" whitepaper [2], I stumbled upon this "optimize for use case"
recommendation, to consider fine-grained vs coarse-grained functionality exposed by the API:
"Expose fine-grained services that users can access directly, and add coarse-grained services on top of them to
support broader use cases. Users can choose to call the fine-grained APIs directly or if they need the combined
functionality of multiple fine-grained calls they can use the coarse-grained APIs."
I think, directly relates to the use-case vs object driven approach mentioned by Mike.
Am I right there is a link between those ideas?
That is, use-case driven design makes coarse-grained APIs, while object-driven makes fine-grained APIs?
[1]
https://groups.google.com/d/msg/api-craft/FQlLigU_n3E/YswTq7BPzK0J[2]
https://www.mulesoft.com/lp/whitepaper/api/secrets-great-apiBest regards,
--
Mateusz Loskot,
http://mateusz.loskot.net