Luar's Flash Playground:[kclyComponent] 設計筆記
[kclyComponent] 設計筆記 (15-10-2004)
將我想到設計問題,通通都記下,目前比較雜亂,將不斷更新…

Packages
  • kcly.component.* (各組件類)
  • kcly.component.core.* (組件共用核心功能類)
  • kcly.component.manager.* (組件運作和使用者操作管理)
  • kcly.util.* (輔助工具類)
Base Classes
  • kcly.component.core.UIComponent 所有組件基類,共同擁有Method private method: init(register init queue, taborder, self init) private method: draw(attach skin mc->event:onLoad) public method: setSize public method: move public method: remove(destroy component->event: onUnload) property: 為所有MovieClip屬性再用Reference指定,例如:x->_x、width->_width,方便編寫ScrollBar時用Dynamic Property更容易做出水平ScrollBar
  • kcly.component.manager.InitManager 當Deferred Instantiation時,根據Queue決定組件draw次序
  • kcly.component.manager.TabManager 管理組件Tab Index,enabled組件是否在Tab Order List中
  • kcly.component.manager.EventManager 管理組件事件queue,enabled組件是否廣播事件
  • kcly.util.Collection 管理郡組Data
Component Classes
  • kcly.component.ListBase public property: defaultSelected{Index/Indices} (不應有change event)
  • kcly.component.BasicButton event: onDoubleClick
開發流程與關聯

Button->ScrollBar->ListBox->ComboBox
ListBox->DataGrid(Phase2)
TextInput->TextArea
ScrollBar->TextArea
CheckBox->RadioButton

備註
  • 畫UML。
  • 記得UnitTest,先設計Test Case。
  • ActionScript跟其他OO語言最大不同地方是Prototype Chain,Loose Type,利用這些特點,多用Reference Object,配合適合Flash的Design Pattern,進行敏捷開發。
  • 是否採用Soure Code開放式(AS1)去設計?不要太Generic?提高開發時間、容易因應需要修改,增刪功能、提高執行效率。
本文章由發表。
同組文章