@Test public void test(){ //new UserImpl(); /* ProxyT proxy=new ProxyT(new UserImpl()); proxy.add(); proxy.update();*/ final User user=new UserI...
分类:
编程语言 时间:
2014-06-26 00:14:14
阅读次数:
260
【创建型】1、单例模式(Singleton Pattern) 2、工厂方法模式(Factory Method Pattern)3、抽象工厂(Abstract Factory Pattern)4、建造者模式(Builder Pattern) 5、原型模式(Prototype Pattern) 【结构型...
分类:
编程语言 时间:
2014-06-25 21:18:34
阅读次数:
247
代理模式(Proxy),为其他对象提供一种代理以控制这个对象的访问。 Subject类,定义了RealSubject和Proxy的公共接口,这样就在任何使用RealSubject的地方都可以使用Proxy。class Subject{public: virtual void Reque...
分类:
其他好文 时间:
2014-06-25 20:38:36
阅读次数:
207
题目
Implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching sh...
分类:
其他好文 时间:
2014-06-25 19:56:35
阅读次数:
275
题目
The string "PAYPALISHIRING" is written in a zigzag pattern on a given
number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
P A H ...
分类:
其他好文 时间:
2014-06-24 23:59:25
阅读次数:
338
欢迎关注我的新博客地址:http://cuipengfei.me/
实在想不到什么动词可以当做脱衣服来讲了,所以从现在开始这系列博文就叫做Desugar Scala了。除非哪天才思泉涌,又想到了新词:)
开始正文。
名字叫做unapply和unapplySeq的方法在Scala里也是有特殊含义的。
我们前面说过case class在做pattern match时很...
分类:
移动开发 时间:
2014-06-24 19:42:48
阅读次数:
265
Observer Pattern 是一种常用的设计模式,它是一种事件监听模型,...
分类:
编程语言 时间:
2014-06-22 20:57:04
阅读次数:
279
前台:
//远程读取设备去向图表数据
var Store1 = new Ext.data.Store({
proxy:{
type:'ajax',
url:'/newmaterial/servlet/GetCountChartGoDatas',
reader:{
type:'array'
}
},
fields:[
"Sys...
分类:
Web程序 时间:
2014-06-22 20:51:18
阅读次数:
314
模板方法模式(template method pattern) 详解本文地址: http://blog.csdn.net/caroline_wendy模板方法模式(template method pattern): 在一个方法中定义一个算法的骨架, 而将一些步骤延迟到子类中. 模板方法使得子类可以在不改变算法结构的情况下, 重新定义算法中的某些步骤.模板方法可以进行挂钩(hook), 钩子(hoo...
分类:
其他好文 时间:
2014-06-22 18:49:01
阅读次数:
227
模式匹配的实现,'?'代表单一字符,'*'代表任意多的字符,写代码实现两个字符串是否匹配。
Implement wildcard pattern matching with support for '?' and '*'.、
'?' Matches any single character.
'*' Matches any sequence of characters (inclu...
分类:
其他好文 时间:
2014-06-22 16:40:44
阅读次数:
225