atitit.设计模式(1)--—职责链模式(chain of responsibility)最佳实践O7 日期转换
1. 需求:::日期转换 1
2. 可以选择的模式: 表格模式,责任链模式 1
3. 调用代码 2
4. 责任链链的特性: 2
5. 模式结构 4
6. 职责链模式包含如下角色:Handler,ConcreteHandler: 具体处理者,HandlerChain...
分类:
其他好文 时间:
2014-07-18 22:31:59
阅读次数:
378
一般情况下如果出现连续跳转的时候,经常会出现result is null的问题,这主要是由于action的type默认类型redirect导致的,
我们只需要在出错的action中指定type=“chain”即可。
例如:
(一般写法:用于同一命名空间的action之间跳转时)
adminMain
(标准写法:用于不同命名空间直接切换跳转...
分类:
编程语言 时间:
2014-07-18 22:19:00
阅读次数:
259
var EventUtil = { addHandler: function(elem,type,handler){ if (elem.addEventListener) { elem.addEventListener...
分类:
其他好文 时间:
2014-07-18 20:21:46
阅读次数:
184
在Android开发过程中,有时候会遇到这样的情况,在一个线程中,执行A操作,B操作需要等A操作结束后才进行,因此需要wait,在java中可以如下代码实现
Handler mBlueHandler = new Handler(Looper.getMainLooper());
Task task = new Task();
mBlueHandler...
分类:
移动开发 时间:
2014-07-18 13:34:17
阅读次数:
323
(上篇文章写完才发现,说好的按顺序但是回头一看完全不是按顺序的)明明WaitForIdle才是第一个。哎,老了,后脑勺不行了。
WaitForIdle
package io.appium.android.bootstrap.handler;
import com.android.uiautomator.core.UiDevice;
import io.appium.andro...
分类:
其他好文 时间:
2014-07-18 12:34:28
阅读次数:
276
上一篇文章中讲了bootstrap的工作流程,这篇文章来研究一下bootstrap可以接受哪些指令(从源码的角度来看,由于appium的项目现在还处在持续更新中,所以有的指令已经实现,某些或许未来会实现,从源码来看的好处是你知道以后或许未来appium能做到哪些功能)。
在bootstrap项目中的io.appium.android.bootstrap.handler包中的类都是对应的相...
分类:
其他好文 时间:
2014-07-18 11:32:43
阅读次数:
191
Chain of Responsibility in the Real WorldThe idea of the Chain Of Responsibility is that it avoids coupling the sender of the request to the receiver,...
分类:
其他好文 时间:
2014-07-18 08:36:38
阅读次数:
294
在后台下载图片,下载完成后更新UI是一个很常见的需求。在没有AsyncTask类之前,我们需要写许多thread和Handler的代码去实现这个功能,有了AsyncTask,一切变得简单了。下面摘抄谷歌官方介绍:AsyncTask is designed to be a helper class a...
分类:
移动开发 时间:
2014-07-17 22:37:48
阅读次数:
308
直接放上我的代码,希望能给碰到同样问题的朋友提供帮助
Runnable runnable = new Runnable() {
public void run() {
ClipboardManager clipboard = (ClipboardManager)GameUtil.getIntance().getContext().getSystemSer...
分类:
其他好文 时间:
2014-07-16 13:50:37
阅读次数:
396
1、使用Thread+Handler实现非UI线程更新UI界面...
分类:
移动开发 时间:
2014-07-16 13:01:21
阅读次数:
221