Interface-mock-live (IML) pattern for connecting with third-party services in Python applications

Interface-mock-live (IML) pattern for connecting with third-party services in Python applications 图片 1

To KISS or not to KISS

I remember how, several years ago at Doist, we talked about integrating with external services, like email providers or analytics tools. The question was whether to use a simple function or an abstraction layer.

We ended up having two groups.

• KISSers. The first one advocated for following theKISS principle and calling the service API directly. Something as simple as storing an API token in your settings, then calling requests.get() on an endpoint. Wrap this in a function and you’re done.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论