为什么星星会眨眼睛| 五谷丰收是什么生肖| 什么是穿刺手术| 血小板低吃什么补的快| 吃什么排毒最快| 男人更年期吃什么药| 什么水是碱性水| 轻描淡写是什么意思| 痔疮挂什么科室| se是什么国家| 心脏跳的快是什么原因| 鼻子和嘴巴连接的地方叫什么| 思维是什么| 狐臭和腋臭有什么区别| 白带发黄有异味是什么原因| 江西特产有什么| 两岁宝宝坐飞机需要什么证件| 发迹是什么意思| 旦角是什么意思| acb是什么意思| 蜂窝数据什么意思| 泌乳素过高女性会出现什么症状| 糖尿病可以吃什么肉| 孕酮代表什么| 6月21号是什么日子| 肚子拉稀像水一样是什么情况| 肚子疼恶心想吐吃什么药| 硬度不够吃什么药调理| 兔日冲鸡什么意思| 手淫多了有什么危害| 荏苒是什么意思| beams是什么品牌| 十一月二十四是什么星座| 送手镯的寓意是什么| 6月1日什么星座| 儿童过敏吃什么药| 四大发明有什么| 生殖器疱疹用什么药| 叻叻猪是什么意思| 回本是什么意思| 雪花飘飘北风萧萧是什么歌| 逆时针揉肚子起什么作用| 为什么上小厕会有刺痛感| 心电图窦性心律不齐是什么意思| 手腕疼痛是什么原因| 吃百合有什么好处| 甘油三脂高是什么意思| 胃结石有什么症状表现| 有始无终是什么生肖| 红斑狼疮复发的症状是什么| 妲己是什么生肖| 朱砂有什么作用与功效| 鲫鱼是什么鱼| 毛囊炎用什么药| 白眼球发黄是什么原因| 孕妇什么东西不能吃| 棕色用什么颜色调出来| 狍子是什么动物| 蜈蚣咬了擦什么药最好| 查激素水平挂什么科| b细胞是什么| 囡是什么意思| 北京古代叫什么| 阑尾炎可以吃什么| 放疗是什么| 谷丙转氨酶偏高吃什么好| 3月23是什么星座| 胃气胃胀吃什么药最好| 头发爱出油是什么原因| 吃什么食物对胰腺好| 立夏节吃什么| 引火上身是什么意思| 尔尔是什么意思| 举不胜举的举是什么意思| 甘油三酯吃什么药| 为什么怀不上孕| 赵云字什么| 男性性功能下降是什么原因| 肝fnh是什么病| 伏吟是什么意思| 柠檬水什么时候喝最好| 梦见买袜子是什么意思| 天文是什么意思| 吃黄瓜有什么好处| 内内是什么意思| 什么样才是包皮| 月什么人什么| 湿疹吃什么食物好| 时光荏苒岁月如梭是什么意思| 泰坦尼克号女主角叫什么| 吃饭咬舌头是什么原因| 6月25什么星座| 胃酸过多吃什么| 教研是什么意思| 什么动物吃蚊子| 子宫肥大是什么原因| ex是什么| sodium是什么意思| 火命适合佩戴什么首饰| 两个方一个土是什么字| elisa是什么检测方法| 118代表什么意思| 为什么会自言自语| 人的血压一天中什么时候最高| 甲状腺结节3类什么意思| 宝宝干呕是什么原因| 舌苔厚白中间有裂纹吃什么药| 桑叶泡水喝有什么功效| 交运是什么意思| 口腔检查挂什么科| 什么是早孕| 11月24日是什么星座| 开大是什么意思| 5月12是什么星座| 狗狗为什么会咬人| 1450是什么意思| 揠苗助长是什么意思| 牛肉馅饺子配什么菜| 年岁是什么意思| 什么水果去火| 69是什么姿势| 下眼皮跳是什么原因| 向日葵什么时候种| td什么意思| 秋天有什么水果成熟| vdr是什么意思| 甲亢用什么药| 为什么会掉头发| 一什么西瓜| 什么原因得疱疹| 白蜡烛代表什么| 手足口病是什么原因引起的| 为什么做完爱下面会疼| 舌头辣辣的是什么原因| 总是口渴是什么原因| 真命天子是什么生肖| 为什么睡觉会突然抖一下| 心机重的人弱点是什么| 朝朝暮暮是什么意思| 胸闷气短挂什么科室| 胃烧心吃什么食物好| 孕期不能吃什么| 中国一词最早出现在什么时候| 脸上经常长痘痘是什么原因| 清宫后可以吃什么水果| 高职本科是什么意思| 鸡蛋黄发红是什么原因| 白蛋白下降是什么原因| 严重失眠吃什么中成药| 含蓄什么意思| 贫血检查查什么项目| 黄辣丁吃什么食物| 纹身的人是什么心理| 家里有壁虎是什么征兆| 梦见黄鼠狼是什么意思| 什么蜂蜜最好| 什么牌子的充电宝好| 五福临门是什么生肖| 罗宾尼手表什么档次| 辛辣都包括什么| 胃癌吃什么药| 蜻蜓是什么动物| 橙字五行属什么| 49岁属什么| 飞蛾为什么会扑火| 舌根发黄是什么原因造成的| 阴道清洁度三度什么意思| 塔丝隆是什么面料| 肺炎为什么要7到10天才能好| 阴道里面长什么样| 内心os是什么意思| 博大精深什么意思| 拜金是什么意思| ubc是什么意思| 潜规则是什么意思| 天性是什么意思| 有什么无什么| 女人身体发热预示什么| 什么是反射| 18k金是什么金| 老虔婆是什么意思| 倒挂对身体有什么好处| 宫腔内钙化灶是什么意思| 善变是什么意思| 草莓什么季节种植| 男人不够硬吃什么好| 仁义道德是什么意思| 资产负债率高说明什么| 虎鲸为什么对人类友好| 狐臭的味道像什么味道| 94年属什么今年多大| 什么病需要透析| 返利是什么意思| 塬字五行属什么| 住院需要带什么东西| 类风湿吃什么药有效| 抽脂手术对身体有什么副作用| 1950年是什么年| 73年属什么生肖| 西藏有什么大学| 肾囊肿是什么原因引起的| 正襟危坐什么意思| 76年出生属什么生肖| 相敬如宾什么意思| 依山傍水是什么意思| 手疼挂什么科| 珠五行属什么| cr是什么意思| 八方来财是什么意思| 做亲子鉴定需要什么东西| 为什么空调外机不转| 阴茎供血不足吃什么药| 男人喜欢什么样的女人做老婆| 宣府是现在的什么地方| 骨质疏松挂什么科| 农村做什么致富| 太岁是什么东西| 一头雾水什么意思| 衬衫搭配什么裤子好看| 樱菜是什么菜| 双子女和什么座最配对| 冷萃是什么意思| 大便化验隐血阳性什么意思| 人有三急指的是什么| 吃什么解油腻| 洋酒是什么酒| 做肠胃镜挂什么科| 月朔是什么意思| 眼睛红红的是什么原因| 身上长疣是什么原因| 龙虾吃什么食物| 头发容易油是什么原因| 越南讲什么语言| 剖腹产吃什么下奶快| 蔓越莓有什么功效和作用| 什么叫前列腺炎| 10.19什么星座| 为什么男生喜欢女生叫爸爸| 不过是什么意思| 肚脐是什么部位| 喉咙发炎吃什么消炎药| 双签是什么意思| 什么是全脂牛奶| 榴莲和什么水果相克| 膀胱炎吃什么药好得快| 减肥可以吃什么| 乾卦代表什么| 什么东西补钙最好最快| body是什么意思| 秉字五行属什么| 阿斯巴甜是什么| 诞辰是什么意思| 害怕是什么意思| 中医心脉受损什么意思| 三维彩超主要检查什么| fbi相当于中国的什么| 炖排骨汤放什么调料| 脚踝浮肿是什么原因引起的| 阴骘是什么意思| 献血有什么坏处| 血管痉挛吃什么药| 德国什么东西值得买| 过期药品属于什么垃圾| 克卜勒是什么意思| 百度
Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

“理上网来·辉煌十九大”-热点专题-中工网

Current License: CC BY-SA 4.0

36 events
when toggle format what by license comment
May 14, 2023 at 9:01 comment added szx To me, all the explanations I've read seem to bil down to the fact that we just add one more layer of abstration between the high and low level components, and that's it. I din't see any "inversion" here.... IMO this is the most vague and confusing principle of SOLID. And there is no clear difference between dependency INVERSION and INJECTION either...
Sep 2, 2022 at 15:15 history edited Derek Greer CC BY-SA 4.0
minor edits
Feb 11, 2022 at 17:29 comment added Derek Greer @AlanEvangelista Consider if you package MyService as a jar file or NuGet package and the logging implementation is log4j or Log4Net. If I use MyService, I'm taking a transitive dependency on log4j or Log4net. The higher level component (MyService) is depending on the lower level component (a logging library), requiring me to use your logging library choice. By expressing MyService's logging capabilities in terms of its own interface, I can provide whatever implementation adaptor I choose.
Nov 11, 2020 at 10:30 comment added Alan Evangelista 1) I have read that the brackets supposedly express that the classes between them are in the same (e.g. Java?) package, but I'm unable to see the difference in practice between MyService → [ILogger ? Logger] and [MyService → IMyServiceLogger] ? Logger. Assuming that ILogger and IMyServiceLogger are classes I created in my application to abstract the implementation details of the logging library I'm using, what's the difference of putting them in different packages? 2) Where is the dependency inversion if MyService depends on an interface and Logger implements that interface in both cases?
Jan 18, 2020 at 1:48 history edited Mark Amery CC BY-SA 4.0
edited body
Jun 25, 2019 at 15:29 history edited Derek Greer CC BY-SA 4.0
fixed grammar
Jun 19, 2019 at 15:21 comment added Derek Greer With the arrows, I was trying to approximate the UML class diagram functions of association and generalization with → and ? respectively. The brackets are indicative that the classes involved are in the same "package" (e.g. in the same assembly in .Net). Understanding the notion of package is a key distinguishing concept when talking about DIP. Otherwise you just end up with the general advice of "Program to an Interface not an Implementation".
Jun 10, 2019 at 10:36 comment added Mark Amery What's the meaning of the syntax with arrows and square brackets (, ?, [, ]) that you use in this answer? They're left undefined here, but are alien to me.
May 31, 2019 at 15:17 comment added Derek Greer I updated the answer to include a link to another article I wrote in 2012 about how the principle applies in dynamically-typed languages like JavaScript.
May 31, 2019 at 15:16 history edited Derek Greer CC BY-SA 4.0
Added link to Javascript article
May 31, 2019 at 15:12 comment added Derek Greer That article could use a little touch-up. I wrote it about 10 years ago and I believe I'd probably do a better job writing it today. That aside, the take-away is that following the DIP shifts ownership of the interface from the concrete implementation to the consumer which naturally leads to differences in how the interface is expressed (i.e. the behavior the consumer needs vs. the behavior the concrete implementation generically offers). Each application tends to have its own Domain-Specific Language, so the interfaces defined will tend to reflect this.
May 31, 2019 at 0:04 comment added Wael @derekgreer The article is amazing, I love it. Thank you! But I have one question though. In the article you mentioned "Additionally, the association of the interface with the higher-level component(s) may in some cases impact the style and naming conventions used in the creation of the interface." What is this impact, and does it matter?
Feb 20, 2019 at 16:19 history edited Derek Greer CC BY-SA 4.0
Added further discussion of the second use case.
Feb 20, 2019 at 15:57 history edited Derek Greer CC BY-SA 4.0
formatting
Feb 16, 2019 at 0:08 comment added Derek Greer I updated the article to include discussion about goals of isolation verses merely library portability.
Feb 16, 2019 at 0:06 history edited Derek Greer CC BY-SA 4.0
Elaborated upon the concept of reuse
Feb 15, 2019 at 22:08 comment added Derek Greer @humbaba I had occasion to read back over this exchange and went back to the book "Agile Principles, ... in C#" wherein it states on pg. 154: "Moreover, it is high-level, policy-setting modules that we want to be able to reuse." So, Martin most definitely has reuse in mind when discussing the DIP. Understand too, reuse doesn't necessarily necessitate multiple uses. When an application's core exists alongside one set of implementation detail components, you can consider that to be one use. When you need to change the impl. details for the same application, that is essentially a second use.
Sep 7, 2018 at 12:22 comment added Derek Greer I’m curious what you believe the primary benefits to be if not reuse. I certainly don’t deny that Uncle Bob sees higher level components as those containing business logic, but pointing that out doesn’t say anything about why this would be a useful practice.
Sep 6, 2018 at 9:40 comment added humbaba If we define the high level components only in terms of reusability, then we cannot understand what DIP is or what its benefits are. High level components are the ones that include the business rules, it does not have much to do with reusability indeed. Everything else should depend on the business rules, not the other way around. You can see that Uncle Bob defines high level components like this while explaining DIP in his Clean Architecture book.
Mar 22, 2017 at 8:28 comment added Birb @DerekGreer: Your example with John and Sam should be in your original reply. Great one!
Mar 10, 2017 at 14:26 comment added FaceBro Inherit to be used instead of using base class, the essence can be summarized as so
Nov 25, 2016 at 17:47 comment added Derek Greer @VF1 That's correct. Components can be either physically coupled (makes a reference to a specific library/assembly), or they can be semantically coupled (nominal interface over a specific implementation). The DIP already presumes the implementation is going to be defined in terms of the interface rather than an interface being defined in terms of the implementation.
Nov 23, 2016 at 18:07 comment added VF1 @DerekGreer I think I understand. Sam's adapter could still be written for an ILogger, but I think the point to drive home is that the easiest interface (in the sense that it's the most minimal) such that it satisfies the requirements necessary to make MyService operate.
Nov 23, 2016 at 17:49 comment added Derek Greer @VF1 Regarding your scenario of needing to change your logging implementation, if your logging requirements necessitates you making changes throughout your system then you haven't defined your abstraction correctly whether you're following the DIP or not. A logging interface that needs to be changed if you decide not to log to the file system is an interface that is semantically coupled to the implementation details.
Nov 23, 2016 at 17:39 comment added Derek Greer @VF1 As stated in the summary paragraph, the importance of the Dependency Inversion Principle is primarily with reuse. If John releases a library that has an external dependency on a logging library and Sam wishes to use John's library, Sam takes on the transient logging dependency. Sam will never be able to deploy his application without the logging library John selected. If John follows the DIP, however, Sam is free to provide an adapter and use whatever logging library he chooses. The DIP isn't about convenience, but coupling.
Jul 21, 2016 at 16:01 comment added VF1 And in cases where the new Logger impl can conform to the old interface, how does this save us anything over the old approach?
Jul 21, 2016 at 16:00 comment added VF1 This is probably the clearest explanation of DIP I've seen. That said, why is it so glorified? As I see it, what we're trying to do is minimize work re-done by changes by making the coupling occur "in the most convenient place possible." If I need to make big changes to Logger (say I'm no longer allowed to use a local file system), I still won't be able to adhere to IMyServiceLogger. It seems like we'd have to make the same amount of changes, everywhere, whether the architecture is MyService → [ILogger ? Logger] or [MyService → IMyServiceLogger] ? Logger.
Apr 2, 2013 at 15:59 comment added TSmith @ Casper Leon Nielsen - D.I.P. has nothing to do with D.I. They are not synonyms nor equivalent concepts.
Jan 8, 2013 at 17:58 comment added Casper Leon Nielsen How I wished people would stop using loggers as the canonical usecase for dependency injection. Especially in connection with log4net where its almost an anti pattern. That aside, kickass explanation!
Jan 8, 2013 at 17:29 history edited Derek Greer CC BY-SA 3.0
Added blurb about the DIP's importance
Dec 13, 2012 at 13:37 comment added ejaenv In the same line its very well explained here: lostechies.com/derickbailey/2011/09/22/…
Aug 15, 2012 at 13:26 history suggested asbachb CC BY-SA 3.0
updated url in answer
Aug 15, 2012 at 13:24 review Suggested edits
Aug 15, 2012 at 13:26
Aug 31, 2009 at 13:45 comment added Patrick McElhaney Thanks. I see now how my answer misses the point. The difference between MyService → [ILogger ? Logger] and [MyService → IMyServiceLogger] ? Logger is subtle but important.
Jul 11, 2009 at 18:05 history edited Derek Greer CC BY-SA 2.5
fixed bolded text
Jul 11, 2009 at 15:20 history answered Derek Greer CC BY-SA 2.5
尽形寿是什么意思 筒骨炖什么好吃 尿喝起来是什么味道 灵犀是什么意思 血压低有什么办法
抑郁症什么症状表现 脱口秀是什么意思 104岁属什么生肖 清远车牌是粤什么 下身痒是什么原因
放鸽子是什么意思 宝宝拉黑色大便是什么原因 什么是息肉 脚老抽筋是什么原因 t是什么意思
妇检tct是什么检查 7月13日什么星座 脸上掉皮是什么原因 保重适合对什么人说 前胸疼是什么原因
鱼和熊掌不可兼得什么意思hcv9jop6ns8r.cn 黄瓜籽有什么功效hcv8jop1ns4r.cn 青字五行属什么jinxinzhichuang.com 八哥鸟吃什么饲料最好hcv8jop1ns7r.cn 手爆皮是什么原因hcv8jop1ns7r.cn
心电图st段改变什么意思weuuu.com 碎银子是什么茶hcv9jop7ns0r.cn 身上长红疙瘩很痒是什么原因hcv9jop0ns0r.cn 文武双全是什么生肖hcv8jop7ns4r.cn 柳州有什么大学hcv8jop5ns7r.cn
孩子打喷嚏流鼻涕吃什么药hcv9jop6ns5r.cn 什么是肌张力hcv8jop2ns9r.cn 肌钙蛋白高是什么原因hcv8jop6ns7r.cn 没什么好怕hcv9jop6ns1r.cn 肌酐偏低是什么意思hcv9jop5ns0r.cn
杰瑞是什么品种的老鼠hcv9jop5ns8r.cn 什么叫冷暴力hcv8jop4ns6r.cn 9月21日是什么星座hcv9jop0ns9r.cn 藿香正气水是什么hcv8jop7ns7r.cn 喉咙里老是有痰是什么原因hcv8jop5ns6r.cn
百度