The adapter design pattern adapter structure (class)

7 257 0
The adapter design pattern   adapter structure (class)

Đang tải... (xem toàn văn)

Thông tin tài liệu

  Client Request() Target* Request ( ) Adapter SpecificRequest() (implementation) specificRequest() Adaptee Convert the interface of a class into another inteface clients expect.  Client Request() Target* Request( ) Adapter adaptee->SpecifricRequest() adaptee specificRequest() Adaptee  ConstraintStateVariable ConstraintVariableStateVariable (to QOCA class hierarchy) (to Unidraw class hierarchy)  ! GetChildren(node) CreateGraphicNode(Node) Display() BuildTree(Node n) TreeDisplay (Client,Target ) GetChildren(node) CreateGraphicNode(Node) DirectoryTreeDisplay (Adapter) FileSystemEntity (Adaptee) GetChildren(n) for each child { AddGraphicNode(CreateGraphi cNode(child)) BuildTree(child) }  " SetDelegate(Delegate) Display() BuildTree(Node n) TreeDisplay* (Client) GetChildren(TreeDisplay, Node) CreateGraphicNode(TreeDisplay, Node) TreeAccessorDelegate* (Target) GetChildren(TreeDisplay, Node) CreateGraphicNode(TreeDisplay, Node) CreateFile() DeleteFile() DirectoryBrowser (Adapter) FileSystemEntity (Adaptee) delegate->GetChildren(this, n) for each child{ AddGraphicNode( delegate->CreateGraphicNode(this, child) ) BuildTree(child) } delegate #$% Object* value: value ValueModel* getBlock setBlock value: value PluggableAdaptor ^ getBlock value:adaptee adaptee . Target* Request ( ) Adapter SpecificRequest() (implementation) specificRequest() Adaptee Convert the interface of a class into another inteface clients. expect.  Client Request() Target* Request( ) Adapter adaptee->SpecifricRequest() adaptee specificRequest() Adaptee  ConstraintStateVariable ConstraintVariableStateVariable (to

Ngày đăng: 19/03/2014, 22:32

Từ khóa liên quan

Mục lục

  • Slide 1

  • Slide 2

  • Slide 3

  • Slide 4

  • Slide 5

  • Slide 6

  • Slide 7

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan