女生小便带血是什么原因| 老舍原名叫什么| 喵星人是什么意思| 受精卵着床有什么反应| 吃什么食物降尿酸最快| 不惑是什么意思| 弯弯的彩虹像什么| 什么食物胆固醇高| 半夜尿多是什么原因| 菲妮迪女装是什么档次| 万岁是什么意思| 肛周水泡是什么病| 草果长什么样| 正值当年什么意思| 检查肾挂什么科| 秃噜皮是什么意思| 法盲是什么意思| mg是什么元素| 什么虫子咬完是小红点| lee什么意思| 间质瘤是什么性质的瘤| 不什么不什么的四字词语| 不停的出汗是什么原因| 脚气用什么药| 胎盘血池是什么意思| 蛇盘疮吃什么药好得快| 此是什么意思| 宫颈机能不全是什么原因造成的| 职别是什么意思| 更年期提前是什么症状| mario是什么意思| 荨麻疹能吃什么水果| 文工团是什么意思| 甲状腺球蛋白高是什么原因| 敏感什么意思| 无语什么意思| 啤酒花是什么| 脖子痒是什么原因| 脚发痒是什么原因| 10月30日什么星座| 右肾盂分离是什么意思| 勾魂是什么意思| 颧骨高适合什么发型| 六腑指的是什么| 白发缺少什么维生素| 全脂牛奶和脱脂牛奶有什么区别| 什么汤什么火| 为什么性生活会出血| 世界上最长的英文单词是什么| 碧根果和核桃有什么区别| 羊脑炎什么症状怎么治| 头皮起疙瘩是什么原因| 六味地黄丸适合什么人吃| 肚子下面是什么部位| 什么是扁桃体| hbv是什么意思| 颈动脉彩超挂什么科| 蒸鱼用什么鱼| 赟怎么读 什么意思| 学子是什么意思| enne是什么烟| 466是什么意思| 光明磊落是什么生肖| 五行火生什么克什么| 大惊小怪是什么生肖| 名媛是什么意思| 世界上最硬的东西是什么| 亲子鉴定需要什么样本| 眼角长脂肪粒是什么原因| 腘窝囊肿是什么原因引起的| 一年级又什么又什么| 九华山在什么地方| 付之一炬是什么意思| 你为什么| 心慌胸闷是什么原因| 合什么意思| 食用碱是什么| 宫颈肥大是什么原因| 在水一方什么意思| 类风湿什么症状| 6月18号是什么日子| 533是什么意思| 打强心针意味着什么| 党按照什么的原则选拔干部| 喉咙有异物感挂什么科| 什么长而去| 爆竹声中一岁除下一句是什么| 始终是什么意思| 刻章需要什么材料| 头皮上长疣是什么原因造成的| 值神是什么意思| 五月七号是什么星座| 不成敬意什么意思| 天冬氨酸氨基转移酶高是什么原因| 阳春三月是什么意思| 乳房头疼是什么原因| 球菌是什么意思| 早搏是什么原因引起的| 什么是非萎缩性胃炎| 头孢全名叫什么| 脂溢性皮炎是什么原因引起的| 馐什么意思| 伤口不愈合用什么药| 脑梗做什么检查最准确| 只是女人容易一往情深是什么歌| 扶他林是什么药| 什么办法退烧快| 什么是朋友| 暗喻是什么意思| 预防高原反应吃什么药| 愿君多采撷是什么意思| 男蛇配什么属相最好| 94年是什么年| 激光脱毛和冰点脱毛有什么区别| 鸡毛菜是什么菜| 心脏有早搏吃什么药好| 觅是什么意思| 眼花是什么原因引起的| 肾结石不能吃什么食物| 酒花浸膏是什么| 低压偏高什么原因| 送老师送什么礼物好| 柏拉图爱情是什么意思| 苦瓜汤为什么要放黄豆| 白色蛇是什么蛇| 吃什么降血压| 1111是什么意思| 七月十六是什么星座| 什么食物可以降血糖| 借你吉言是什么意思| 双鱼座的幸运色是什么颜色| 啪啪是什么意思| 惊艳了时光温柔了岁月什么意思| 梦见假牙掉了是什么意思| 世袭罔替是什么意思| 什么鸡| mw是什么单位| 低密度脂蛋白高有什么危害| 苹果什么时候出新手机| 四岁属什么生肖| bc是什么牌子| 类风湿吃什么药最有效| 布谷鸟什么时候叫| 子宫内膜ca是什么意思| 感恩节为什么要吃火鸡| 肾是干什么用的| 小壁虎吃什么| 男人尿道炎吃什么药最好| 尿痛什么原因引起的| 拉肚子发烧吃什么药| 女性尿液发黄是什么原因| 更年期的女人有什么症状表现| 子宫内膜单纯性增生是什么意思| 铁锈红配什么颜色好看| 承恩是什么意思| tbc是什么意思| 二十岁是什么之年| 最小的动物是什么| 生吃黄瓜有什么好处| 亲嘴有什么好处| 流虚汗是什么原因| 山狸是什么动物| 11.22什么星座| 好奇害死猫什么意思| 3.5是什么星座| 慢性萎缩性胃炎吃什么食物好| 月经前便秘是什么原因| 高锰酸钾治疗男性什么病| 妲是什么意思| 什么的山野| 窦性心律左室高电压什么意思| 1990年属马的是什么命| 快走对身体有什么好处| pacu是什么意思| 速度是70迈心情是自由自在什么歌| 凌晨2点是什么时辰| 制作人是干什么的| 肝胆胰脾彩超查什么病| 耐受是什么意思| 不是经期有少量出血是什么原因| 血气是什么意思| 为什么吃甲鱼不吃乌龟| 做梦梦到牙齿掉了是什么意思| 猪肝吃多了有什么坏处| 黄瓜有什么营养| 女性更年期潮热出汗吃什么药| 世态炎凉是什么意思| 紫砂壶泡什么茶最好| 便秘应该吃什么| 屁股一侧疼是什么原因| 法西斯是什么意思| fierce是什么意思| 血糖高适合吃什么蔬菜| 热泪盈眶的盈是什么意思| 下雨天穿什么衣服| 脚后跟疼挂什么科| ood是什么意思| 卒中中心是干什么的| hpv检查什么| 胃阴虚吃什么中成药| uniqlo是什么牌子| 回字是什么结构| 1946年属什么生肖属相| 阴囊潮湿瘙痒是什么原因| 痒是什么原因引起的| 最高位是什么位| 尿肌酐低说明什么原因| 梦见自己开车是什么意思| 淼念什么| 黄酮对女性有什么作用| 数字化摄影dr是检查什么| 血压低有什么危险| 女人适合喝什么茶最好| 男生圆脸适合什么发型| 弱的部首是什么| 肌红蛋白高说明什么| 肝属于五行中的什么| enne是什么烟| 喉咙痛喝什么| 小孩上火吃什么药| 8月5日是什么星座| 六指是什么原因导致的| 基础病是什么意思| 怎么看微信好友什么时候加的| 为什么下巴经常长痘痘| 排山倒海是什么意思| 胖脸女人适合什么发型| 腰间盘突出用什么药好| 刑事拘留意味着什么| 喝酒对身体有什么影响| 日头是什么意思| 吃榴莲有什么坏处| 人设什么意思| 粑粑是什么意思| 梦见长白头发是什么意思| 4岁小孩流鼻血是什么原因| 鲶鱼是什么鱼| 肺结节影是什么意思啊| 胃胀吃什么中成药| 彩宝是什么| maby什么意思| 什么是脂肪瘤| 脖子上为什么会长丝状疣| 梦见僵尸是什么预兆| 下架是什么意思| 声音的传播需要什么| 63年的兔是什么命| 什么发型好看| 拐子是什么意思| 蟾蜍是什么| 什么是肾阴虚和肾阳虚| 老人走之前有什么预兆| 牙齿根管治疗是什么意思| 阿达子是什么| 关晓彤属什么生肖| 世界上最多的动物是什么| 抖s是什么意思| 6月1号什么星座| 小孩咳嗽流鼻涕吃什么药效果好| 心率低40多吃什么药| o型血和b型血的孩子是什么血型| 什么叫玄学| 纳豆是什么豆子| 夏天吃羊肉有什么好处| 百度Jump to content

中国开建万吨大驱一年4艘上船台 建造速度令美惊叹

From Wikipedia, the free encyclopedia
百度 但最新消息称,特朗普称考虑对该议案使用否决权。

In software engineering and programming language theory, the abstraction principle (or the principle of abstraction) is a basic dictum that aims to reduce duplication of information in a program (usually with emphasis on code duplication) whenever practical by making use of abstractions provided by the programming language or software libraries.[1] The principle is sometimes stated as a recommendation to the programmer, but sometimes stated as a requirement of the programming language, assuming it is self-understood why abstractions are desirable to use. The origins of the principle are uncertain; it has been reinvented a number of times, sometimes under a different name, with slight variations.

When read as recommendations to the programmer, the abstraction principle can be generalized as the "don't repeat yourself" (DRY) principle, which recommends avoiding the duplication of information in general, and also avoiding the duplication of human effort involved in the software development process.

The principle

[edit]

As a recommendation to the programmer, in its formulation by Benjamin C. Pierce in Types and Programming Languages (2002), the abstraction principle reads (emphasis in original):[2]

Each significant piece of functionality in a program should be implemented in just one place in the source code. Where similar functions are carried out by distinct pieces of code, it is generally beneficial to combine them into one by abstracting out the varying parts.

As a requirement of the programming language, in its formulation by David A. Schmidt in The structure of typed programming languages (1994), the abstraction principle reads:.[3]

The phrases of any semantically meaningful syntactic class may be named.

History and variations

[edit]

The abstraction principle is mentioned in several books. Some of these, together with the formulation if it is succinct, are listed below.

  • Alfred John Cole, Ronald Morrison (1982) An introduction to programming with S-algol: "[Abstraction] when applied to language design is to define all the semantically meaningful syntactic categories in the language and allow an abstraction over them".[4]
  • Bruce J. MacLennan (1983) Principles of programming languages: design, evaluation, and implementation: "Avoid requiring something to be stated more than once; factor out the recurring pattern".[5]
  • Jon Pearce (1998) Programming and Meta-Programming in Scheme: "Structure and function should be independent".[6]

The principle plays a central role in design patterns in object-oriented programming, although most writings on that topic do not give a name to the principle. The Design Patterns book by the Gang of Four, states: "The focus here is encapsulating the concept that varies, a theme of many design patterns." This statement has been rephrased by other authors as "Find what varies and encapsulate it."[7]

In this century, the principle has been reinvented in extreme programming under the slogan "Once and Only Once". The definition of this principle was rather succinct in its first appearance: "no duplicate code".[8] It has later been elaborated as applicable to other issues in software development: "Automate every process that's worth automating. If you find yourself performing a task many times, script it."[9]

Implications

[edit]

The abstraction principle is often stated in the context of some mechanism intended to facilitate abstraction. The basic mechanism of control abstraction is a function or subroutine. Data abstractions include various forms of type polymorphism. More elaborate mechanisms that may combine data and control abstractions include: abstract data types, including classes, polytypism etc. The quest for richer abstractions that allow less duplication in complex scenarios is one of the driving forces in programming language research and design.

Inexperienced programmers may be tempted to introduce too much abstraction in their program—abstraction that won't be used more than once. [citation needed] A complementary principle that emphasizes this issue is "You Ain't Gonna Need It" and, more generally, the KISS principle.

Since code is usually subject to revisions, following the abstraction principle may entail refactoring code.[citation needed] The effort of rewriting a piece of code generically needs to be amortized against the estimated future benefits of an abstraction. A rule of thumb governing this was devised by Martin Fowler, and popularized as the rule of three. It states that if a piece of code is copied more than twice, i.e. it would end up having three or more copies, then it needs to be abstracted out.

Generalizations

[edit]

"Don't repeat yourself", or the "DRY principle", is a generalization developed in the context of multi-tier architectures, where related code is by necessity duplicated to some extent across tiers, usually in different languages. In practical terms, the recommendation here is to rely on automated tools, like code generators and data transformations to avoid repetition.[citation needed]

Hardware programming interfaces

[edit]

In addition to optimizing code, a hierarchical/recursive meaning of Abstraction level in programming also refers to the interfaces between hardware communication layers, also called "abstraction levels" and "abstraction layers." In this case, level of abstraction often is synonymous with interface. For example, in examining shellcode and the interface between higher and lower level languages, the level of abstraction changes from operating system commands (for example, in C) to register and circuit level calls and commands (for example, in assembly and binary). In the case of that example, the boundary or interface between the abstraction levels is the stack.[10]

References

[edit]
  1. ^ Mishra, Jibitesh (2011). Software Engineering. Pearson Education India. ISBN 978-81-317-5869-4.
  2. ^ Pierce, Benjamin (2002). Types and Programming Languages. MIT Press. p. 339. ISBN 0-262-16209-1.
  3. ^ David A. Schmidt, The structure of typed programming languages, MIT Press, 1994, ISBN 0-262-19349-3, p. 32
  4. ^ Alfred John Cole, Ronald Morrison, An introduction to programming with S-algol, CUP Archive, 1982, ISBN 0-521-25001-3, p. 150
  5. ^ Bruce J. MacLennan, Principles of programming languages: design, evaluation, and implementation, Holt, Rinehart, and Winston, 1983, p. 53
  6. ^ Jon Pearce, Programming and meta-programming in scheme, Birkh?user, 1998, ISBN 0-387-98320-1, p. 40
  7. ^ Alan Shalloway, James Trott, Design patterns explained: a new perspective on object-oriented design, Addison-Wesley, 2002, ISBN 0-201-71594-5, p. 115
  8. ^ Kent Beck, Extreme programming explained: embrace change, 2nd edition, Addison-Wesley, 2000, ISBN 0-201-61641-6, p. 61
  9. ^ Chromatic, Extreme programming pocket guide, O'Reilly, 2003, ISBN 0-596-00485-0
  10. ^ Koziol, The Shellcoders Handbook", Wiley, 2004, p. 10, ISBN 0-7645-4468-3
europe是什么意思 完蛋是什么意思 封闭是什么意思 酸笋炒什么好吃 狐狸和乌鸦告诉我们什么道理
山竹不能和什么水果一起吃 重症肌无力是什么原因引起的 市级三好学生有什么用 狗狗为什么喜欢舔人 1990年是什么命
重庆古代叫什么 狗狗拉肚子吃什么药 布洛芬治什么 嘴唇边缘发黑是什么原因 菀字五行属什么
什么是气 pth是什么 10月7号是什么星座 子宫后位什么意思 二黑是什么意思
什么是筋膜hcv8jop1ns0r.cn 整夜失眠是什么病hkuteam.com q波异常是什么意思hcv9jop4ns8r.cn 肺部做什么检查最准确hcv7jop9ns0r.cn 利是是什么意思hcv8jop5ns7r.cn
白带发黄有异味用什么药hcv7jop7ns0r.cn 农历9月14日是什么星座hcv8jop5ns0r.cn 猪肝吃多了有什么坏处hcv7jop6ns2r.cn 女性耻骨疼是什么原因hcv8jop7ns3r.cn 我拿什么留住你hcv8jop0ns0r.cn
天地银行是什么意思hcv8jop1ns7r.cn 1987属什么生肖hcv7jop6ns0r.cn 景泰蓝是什么地方的特种工艺hcv7jop4ns5r.cn 参谋是什么军衔hcv8jop8ns5r.cn 火加木是什么字hcv9jop6ns4r.cn
肚子疼想吐是什么原因hcv9jop3ns1r.cn 作奸犯科是什么意思inbungee.com 治疗呼吸道感染用什么药最好hcv8jop5ns8r.cn 盎司是什么单位hcv9jop2ns6r.cn 六月二十日是什么日子hcv8jop4ns3r.cn
百度