controller+state+observer
2016-06-18 12:36:20 0 举报
Controller+State+Observer是一种设计模式,用于实现对象之间的通信。其中,Controller负责控制对象的行为,State表示对象的状态,Observer则用于观察对象状态的变化并作出相应的反应。该模式通过将对象的依赖关系从紧密耦合中解耦出来,使得对象之间的交互更加灵活和可扩展。同时,它也提高了代码的复用性和可维护性。在实际应用中,该模式被广泛应用于GUI编程、游戏开发等领域。
作者其他创作
大纲/内容
state
- classified()- unclassified()- deleted()
GUI
+ static getInstance()- GUI()
- GUI instance
SavaToDB
excute()saveDB()
AbstractRequrements
BP Factory
creatVN():VN-Phrase
Observable
+getState()+add(o:Observer)+notify()+remove()
Modle
delegate
action Factory
actionList
iterator():Iteratorupdata()
Requirements
BPList
open
Iterator
iirst()nex()isDone()currentItem():VNPhrase
Collection
iterator():Iterator
VN Factory
BPListIterator
get state
return new() Business process
requirementSpecifiction
- requirementSpecifiction Instance
static getInstance():requirementSpecifictionprivate requirementSpecifiction()saveXML()saveTxT()saveDB()
control
User
SavaAsTexture
excute()saveTxT()
return new() step
unExisted
- unclassified()- deleted()
stepList
Observer
+ updata()
SaveCommand
excute():Object
classified
- classified()
step Factory
SaveAsXML
excute()saveXML()
Classify Controller
- classify()- highLight()
Existed
- unclassified()
return new() action
0 条评论
下一页