Propagating context using Scala's using/given

We have all seen and used the infamous "context" object. Some information, whether it's the current user's authentication and authorization information or the current transaction, has to be passed through all the nice layers and slices of our software system. It starts small and, if not carefully controlled, becomes a large incoherent grab-bag of data over time. We can try to hide it in a thread-local variable, which at least avoids the pollution of the APIs in our application with the "context" parameter,

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