- Gof/Mediator
* Colleague classes(listBox, Entry Field)
ListBox, EntryField, Button은 특화된 사용자 인터페이스 요소를 위한 DialogDirector의 subclass들이다. ListBox는 현재 선택을 위해서 GetSelection연산자를 제공한다. 그리고 EntryField의 SetText 연산자는 새로운 text로 field를 채운다.
class ListBox:public Widget {
ListBox(DialogDirector*);
ListBox* _fontList;
_fontList = new ListBox(this);
// fill the listBox white the available font names
윈도우용 Smalltalk/V의 application구조는 mediator 구조에 가반을 두고 있다.[LaL94] 그런 환경에서 application은 윈도우를 pane들의 모음으로 구성하고 있다. library는 몇몇의 이미 정의된 pane들을 가지고 있다. 예를 들자면 TextPane, ListBox, Button등등이 포함된다. 이러한 pane들은 subclassing없이 이용될 수 있다. Application 개발자는 단지 inter-pane coordination할 책임이 있는 ViewManager만 subclassing할 수 있다. ViewManage는 Mediator이고 각각의 pane들은 자신의 owner로서 단지 자신의 ViewManager를 알고 있다. pane들은 직접적으로 서로 조회하지 않는다.
다음 코드 인용은 ListBox가 ViewManager subclass 내에서 만들어지는 방법과 #select event를 위해 ViewManager가 event handler를 등록하는 방법을 보여주고 있다.
Found 1 matching page out of 7544 total pages
You can also click here to search title.