设计模式之策略模式: Strategy Design Pattern

适用情景:   假如有一组相关的算法, 客户需要从中动态选择一个来使用. 譬如: 学校中的新生分班, 有按照成绩分班, 按照性别分班, 按照住宿类型分班等等.  (当然实际情况中的分班考虑因素会更复杂一些)
最简单的方法是一个Method, 通过判断类型进行相应操作. 但这样做的是这个Method会巨大无比, 不易维护. 因此我们可使用Strategy模式, 会多一些Interface或Class, 但会降低耦合, 拥有更佳的可扩展性.
_SHUPZTTF4MMN_D7DT7TBX0(ActionScript)
负责进行分班的主体类包含IClassEnrollStrategy的一个Instance, 对于这个

More…

by 老李 | Tagged , , | 1 Comment

About the overloading in Flex

Those days I’m looking a new job related to Java and Flex… Seems that this is a popular interview question, I event didn’t encounter it in the ACE. But I was asked more than 3 times.
Talk about overloading in OOPS:
Overloading is between the methods with the same name, If two methods of a class (wh

More…

by 老李 | Tagged , | Leave a comment

Let the Flex thread sleep for a while

Sometimes we use thread.sleep to let the thread stop running for a while in Java, but in Flex, we can’t  control the thread, but sometimes we want to let the method sleeping,  and here is what I’ll do:
public class SleepUtils
{
// Constructor
public function SleepUtils() {
}

/**
* L

More…

by 老李 | Tagged , | Leave a comment

Flex Event stopimmediatepropagation VS stoppropagation

What’s the difference ? Here is the test codes:
We will create a button in a Group, and listen the button click event(MouseEvent.Click):
protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void {
// Create button and container
var hbox:HGroup = new HGroup();

More…

by 老李 | Tagged , , | Leave a comment

发点Adobe Flex 3 with AIR ACE认证真题 – 全凭记忆, 仅供参考

满共50道题, 大概想起来45道, 人上了年纪后脑子就不灵光了, 只能大致描述下题目主要内容, 能用中文描述的用了中文, 搞不定的保持英文. 有些选项也记得不全, 仅供复习参考.

已整理成PDF, 下载页面: http://dl.dbank.com/c0ygcsiqso

Update:

又想起来一道Air题目:

在Mac上如何删除Air程序: 大致选项:
1. 运行Uninstall Script; 2. 删除文件; 3. 运行安装包; 4. 删除快捷方式一类的…具体项目及不太清楚了, 5选2;

by 老李 | Tagged , , | Leave a comment