2019年编程语言中的架构思考.pdf

编号:97519 PDF 66页 12.71MB 下载积分:VIP专享
下载报告请您先登录!

2019年编程语言中的架构思考.pdf

1、编程语言中的架构思考Dont Believe Me!Composition over inheritance?Does Golang need dependency injection?Do we need a complete interface?OOPInheritanceInheritanceInheritance is the mechanism of basing an object or class upon another object(prototypical inheritance)or class(class-based inheritance),retaining sim

2、ilar implementation.What is the role of inheritance?Code Reuse/DRY?When to use inheritance?IS-A?Java Standard LibraryStackMethods inherited from class java.util.Vector add,add,addAll,addAll,addElement,capacity,clear,clone,contains,containsAll,copyInto,elementAt,elements,ensureCapacity,equals,firstEl

3、ement,get,hashCode,indexOf,indexOf,insertElementAt,isEmpty,iterator,lastElement,lastIndexOf,lastIndexOf,listIterator,listIterator,remove,remove,removeAll,removeAllElements,removeElement,removeElementAt,removeRange,retainAll,set,setElementAt,setSize,size,subList,toArray,toArray,toString,trimToSizecla

4、ss Bird(object):name=Bird def fly(self):print(self.name+can fly)def lay(self):print(self.name+can lay)def run(self):print(self.name+can run)class Ostrich(Bird):name=Ostrich def swim(self):print(self.name+can swim)Inheritance break Encapsulationclass Bird(object):name=Bird def fly(self):pass def lay(

5、self):print(self.name+lay)def run(self):print(self.name+run)class Ostrich(Bird):name=Ostrich def fly(self):raise Exception(self.name+cant fly)class Goddess(self):name=Goddess def pray(self):print(self.name+pray)def release_bird(self,bird):self.pray()bird.fly()class Goddess(self):name=Goddess def pra

6、y(self):print(self.name+pray)def release_bird(self,bird):self.pray()if isinstance(bird,Ostrich):bird.run()else:bird.fly()Liskov substitution principleWhat is wanted here is something like the following substitution property:If for each object o1 of type S there is an object o2 of type T such that fo

友情提示

1、下载报告失败解决办法
2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
4、本站报告下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。

本文(2019年编程语言中的架构思考.pdf)为本站 (云闲) 主动上传,三个皮匠报告文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三个皮匠报告文库(点击联系客服),我们立即给予删除!

温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。
客服
商务合作
小程序
服务号
折叠