by bonesss 3 days ago

So, why not write to a shared wrapper/facade?

If you split the interaction API out to an interface detailing actual program interaction with the service, then write an s3 backend and an FS backend. Then you could plug in any backend as desired and write agnostic application code.

Personally I end up there anyways testing and specifying the third party failure modes.

thayne 3 days ago | [-1 more]

What if you need it because you are using a third party application that requires an s3 api? Or you want to test your code that interacts with an s3 API?

bonesss 2 days ago | [-0 more]

Same answer, wrap you usage and use the wrapper for agonistic testing & coding.

That’s the entire point: my domain code ‘stores’ something, my implementation decides if that is S3 or a fixed kind of error or writes to a disc.

If my domain uses a third party app that needs an S3 API, and we see not pointing it at S3, then I am writing an s3 API to test that dependency and ensure the third party code works regardless. Normally I’d call that “their problem” and call their service with the same wrapper as above.