My team needs to design an API which sends objects to a queue in the cloud and retrieves objects from it. The data is inserted into the queue as
We have 2 ideas until now which I would love to hear your notes/ideas about them:
public void push(String object)
public String retrieve()
Notes: To support this API, any consumer must implement a logic to convert his objects to
Strings and vice versa.
- Easy to implement.
- Easy to maintain.
- The consumer of our API must design a solution which is not related to his logic for converting his objects to
- The consumer of our API must call a method which converts his objects by himself even though it is not related to his logic.
public void <T> push(T object)
public T <T> retrieve(Class<T> type)
- Easy to implement. (In Java, we can use
- Easy to use this API.
- The consumer of our API does not need to manually convert his objects to anything else.
- The types of the consumer of our API must support
Jsonconverts - recursively, a class with object properties, all property types must support
- If the consumer does not read the documentation carefully, something won't work or there will be a silent bug.
- The API needs to be supported for at least 4 years.