Skip to main content

[AIR] Value Object classes creator



會花時間做這個App完全是 Erin 懶人血液作祟...
由於開發過程中會使用一些Value Object classes 每次要新增就得將舊的 VO class copy and paste 然後打開 AS 檔剪剪貼貼...光這樣的過程重複個幾次就非常惱人,為了一勞永逸隨手用 Flex 3 Build 了一個 VO creator...XD

使用方法很簡單
只要將 VOCreator 上的空白欄位填上,點選Save as就可以了...

輸出 myVO.as:
/**
* This class was created by AS3 VOCreator v1.0
* Copyright (c) 2008 Erin Lin
* All rights reserved.
* + + + + + + + + + + + + +
* Project : yourProjectName
* Name : myVO.as
* Date : Wed Nov 26 13:20:46 GMT+0800 2008
**/
package com.you.vo
{
public class myVO
{
private var _var1:String;
private var _var2:int;
public function myVO(){}
/**
* Set var1
*
* @param var1 the value to set.
**/
public function set var1(value:String):void{
_var1=value;
}
/**
* Get var1
*
* @return var1 as String.
*/
public function get var1():String{
return _var1
}
/**
* Set var2
*
* @param var2 the value to set.
**/
public function set var2(value:int):void{
_var2=value;
}
/**
* Get var2
*
* @return var2 as int.
*/
public function get var2():int{
return _var2
}
}
}


線上安裝:

Please upgrade your Flash Player
This is the content that would be shown if the user does not have Flash Player 9.0.115 or higher installed.

Comments

Popular posts from this blog

PureMVC 我也會 [6]

Mediator ViewComponents 與 pureMVC 架構的中介 監聽並反應 View Component 發出的 Event 可以發送與接收 Notification 儘量少操作 Proxy 公開方法,多用 sendNotification... Mediator design pattern 要多認識這個 Mediator 設計模式的話,請自行看連結說明啊! 簡單來講,假使有一個 View 裡面有好幾個 MovieClip 組成,而這些 MovieClip 會互相影響對方...這個情況在 Flash 中,通常都會變成下圖: MovieClip 直接控制其他 MovieClip 搞到整個關係很複雜...換一個元件簡直是災難。 加入 Mediator 後,示意圖就會變成: 這樣,所有的 MovieClip 都透過 Mediator 來跟其他 MovieClip 溝通,當某一個 MovieClip 替換成別的元件,這時候也只需要修改 Mediator 中的引用即可,是不是變得很乾淨?如果同一組 MovieClip 有另外一個操作模式,也只需要替換掉 Mediator 即可!天下太平啊~~~ 而 PureMVC 中就是利用 Mediator class 為與前端 ViewComponent 的中介,這樣可以切開 ViewComponent 與 PureMVC framework 的關係,不管你前端介面使用 Flash or Flex 製作都跟程式核心無關。 所以 ViewComponent 製作時只需要兩個原則,一把所有的請求都以 Event 送出由 Mediator 處理,二提供公開方法, Mediator 只需要監聽 View 的 Event,將收到的資訊透過公開方法喂進 ViewComponent 即可。 如在 ViewComponent 中: public function setList( result:Object ):void{ list.dataProvider = result as ArrayCollection; } //然後在按下取得資料的按鈕 Click action 寫上: dispatchEvent( new Event( "GET_LIST" )); 新建 Mediator 的時候一樣有幾個重點方...