- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
编程需要注意的陷阱java继承是有害的(Note Java programming trap inheritance is harmful)
编程需要注意的陷阱java继承是有害的(Note Java programming trap inheritance is harmful)
Most of the good designers like the plague to avoid the use of inheritance (extends relationship). In fact, 80% of the code should be written entirely in interfaces, but not by extends. JAVA design pattern a book described in detail how to use interface inheritance instead of implementation. This article describes why so as a designer.
Extends is harmful; perhaps for Charles Manson this level is not bad enough, but it should be avoided whenever possible. JAVA design pattern a Book spent a great part of the discussion with interface instead of inheritance inheritance.
Good designer in his code, most with interface, rather than a specific class. This paper discusses why the designers will choose, and also introduces some basic programming based on interface.
Interface (Interface) and (Class)?
Jams Gosling (father of Java) as promoters of speech. Someone asked him: if you re structure the Java, what do you want to change?. I want to abandon the classes he answered. In the laughter subsided, it explained that the real problem is not due to class itself, but the implementation of inheritance (extends relationship). Interface inheritance (implements relation) is better. You should avoid as far as possible implementation.
Lost flexibility
Why should you avoid inheritance? The first problem is to use a specific class name will clear you fixed to the specific implementation, not necessarily more difficult to change the underlying.
In the current agile programming method, the core is the concept of the design and development of the parallel. In your detailed design procedure before you start programming. This technology is different from the traditional method of the form, the traditional way is to design should be completed before the start of encoding -- but many successful projects have shown that you can develop high quality code more quickly, compared with the traditional method of follow the prescrib
您可能关注的文档
- 简单七步做个成功赚钱的网店卖家(Seven simple steps to make a successful money online sellers).doc
- 简单做管理需要大管理智慧(Simple management needs management wisdom).doc
- 简单学五笔,轻松学开车。(Simple five pen, easy to learn to drive.).doc
- 简单摄影教程(Simple photography).doc
- 第四课 版画(2课时)(Lesson fourth prints (2 hours)).doc
- 简单明了seo学习教程(Simple SEO tutorial).doc
- 答疑综合布线施工常见问题(The common questions of integrated wiring construction).doc
- 简单记事本的写法(Simple Notepad written).doc
- 简历注水易弄巧成拙(Resume water injection easy to self defeating).doc
- 简易增高(Simple.).doc
- 编程学习(Programming learning).doc
- 缝纫机故障排除(Troubleshooting of sewing machine).doc
- 缝纫机解决办法(Sewing machine solutions).doc
- 缝纫机跳线,断线如何维修(How to repair the broken sewing machine jumper).doc
- 缝纫线规格(Sewing thread).doc
- 缩小地区经济差异的财政政策建议(Financial policy proposals to reduce regional economic disparity).doc
- 网上申办《一孩生育证》暂行管理办法(Interim administration measures for bidding for one child birth certificate on the Internet).doc
- 网吧管理考核制度(仅供参考)(Internet cafe management examination system (for reference only)).doc
- 网商生存法则(Survival rules of network operators).doc
- 缺失的中学语文新诗教学及其改进策略(The teaching of missing Chinese poetry in middle school and its improvement strategy).doc
最近下载
- 中国云新南航空公司acars系统培训.ppt VIP
- 马克思主义宗教观87814.ppt VIP
- 《城市轨道交通通信与信号》教案 第11课 城市轨道交通通信系统(一).docx VIP
- 大众蔚领保养手册.docx VIP
- 部编人教版小学4四年级语文上册(全册)优秀教案设计.doc VIP
- 道德与法治新教材培训心得体会.pptx VIP
- 2026年高考化学大一轮复习第3讲离子共存 离子的检验与推断.pptx VIP
- 冯唐成事心法读书札记.docx VIP
- 第1课 时代精神的精华-【中职专用】2024年中职思想政治《哲学与人生》金牌课件(高教版2023·基础模块).pptx VIP
- 《新闻采访与写作》电子课件 第三章 新闻采写的客体——新闻事实.ppt VIP
文档评论(0)