mardi 16 mai 2017

What design pattern for client calls to a remote service (api client)

I'm currently designing an architecture of an app, basically, you can:

  • Retrieve items from a remote service (consuming a http rest api)
  • Rate the items (using an http rest api too)

So I basically set up my domain layer to access the items using a repository pattern.

And now I'd like to know where to put the logic for sending the request for rating the items

Is it wrong if I put it inside the repository? or should I keep the repository just for item retrieval and filtering tasks?

Aucun commentaire:

Enregistrer un commentaire