Item 18: Make interfaces easy to use correctly and hard to use incorrectly.
“让接口容易被正确使用,不易被误用”,这也是面向对象设计中的重要概念,好的接口在工程实践中尤其重要。 在使用优秀的第三方组件时,常常能够切身感受到好的接口原来可以这么方便,甚至不需记住它的名字和参数就能正确地调用。 反观自己写的API,常...
分类:
编程语言 时间:
2015-08-29 14:08:50
阅读次数:
245
Ubuntu的网络参数保存在文件 /etc/network/interfaces中,默认设置使用dhcp,内容如下:# The primary network interfaceauto eth0iface eth0 inet dhcp设置静态ip的方法如下:(1)编辑 /etc/network/i...
分类:
其他好文 时间:
2015-08-27 22:39:26
阅读次数:
127
threading — Higher-level threading interface¶Source code: Lib/threading.pyThis module constructs higher-level threading interfaces on top of the lower...
分类:
其他好文 时间:
2015-08-20 23:57:54
阅读次数:
332
?Architects’ Focus Is on the Boundaries and InterfacesEinar LandreSinCE loRd nElSon dESTRoyEd the French and Spanish fleet at Trafalgar in 1805, “divide and conquer” has been the mantra for dealing wit...
分类:
其他好文 时间:
2015-08-20 10:36:40
阅读次数:
116
许多windows非常熟悉ipconfig命令行工具,它被用来获取网络接口配置信息并对此进行修改。Linux系统拥有一个类似的工具,也就是ifconfig(interfaces config)。通常需要以root身份登录或使用sudo以便在Linux机器上使用ifconfig工具。依赖于ifconfig命令中使用一些选项属性,ifconfig工具不仅可以被用来简单地获取网络接口配置信息,还可以修改...
分类:
其他好文 时间:
2015-08-19 13:33:12
阅读次数:
104
一. Java反射机制
Reflection 是Java被视为动态(或准动态)语言的一个关键性质。这个机制允许程序在运行时透过Reflection APIs取得任何一个已知名称的class的内部信息,包括其modifiers(诸如public, static 等等)、superclass(例如Object)、实现之interfaces(例如Serializable),也包括fields和meth...
分类:
移动开发 时间:
2015-08-19 11:13:17
阅读次数:
217
要讲反射,我们必须要弄清楚ClassObject,因为反射提供的方法都是ClassObject提供的。下面是java.lang.Class的类注释: Instances of the class Class represent classes and interfaces in a running....
分类:
编程语言 时间:
2015-08-19 00:21:54
阅读次数:
128
声明:本文内容是从网络书籍整理而来,并非原创。定义
第一种定义:
Clients should not be forced to depend upon interfaces that they don’t use.
客户端不应该依赖它不需用的接口。第二种定义:
The dependency of one class to another one should depend on th...
分类:
其他好文 时间:
2015-08-18 09:11:11
阅读次数:
129
接口 TypeScript的一个核心原则是类型检测重点放在值的形状(shape),这有时候被称为鸭子类型化(duck typing)或结构子类型化(structural subtyping)。在TypeScript中,用接口(interfaces)来命名这些类型,...
分类:
其他好文 时间:
2015-08-17 12:23:07
阅读次数:
379
$ vim /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network in...
分类:
其他好文 时间:
2015-08-16 02:09:34
阅读次数:
154