阅读背景:

基于DDD实践,这个逻辑应该放在哪里,如何避免不必要的依赖?

来源:互联网 

I'm adding some logic to my web app to lookup geo-coordinates for a user, store them, then using those coordinates lookup the timezone and store that. My first go at this was to add a GeoCodeUser() method to a MappingService i had defined to do other map-related tasks. Because looking up the two bits of data relied on two different REST services, I broke the two lookup tasks into AddressGeoCoder and TimeZoneCoder and used those to retrieve the data and the UserRepository to store them. The odd part of this solution is that though this method needs access to the repository and two 'coders', the other methods in the class didn't. So every time I use that service to do other things I'm getting dependencies I don't need and then dropping them. So here is what I am wondering:I'm adding some logic to my web app to lookup g




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: