Design Pattern suggestions?
-
I have control that somewhat resembles a tree, where each control node have one or many group nodes (CGroupNode), and each group node have one or many leaf nodes(CLeafNode). New requirement is: Decouple control from data. So that there will be: CTreeControl(draw gui, sends actions) and CTreeDataProvider provides data about group, leaf nodes to CTreeControl. Any suggestions on what pattern shall I use? Brian
-
I have control that somewhat resembles a tree, where each control node have one or many group nodes (CGroupNode), and each group node have one or many leaf nodes(CLeafNode). New requirement is: Decouple control from data. So that there will be: CTreeControl(draw gui, sends actions) and CTreeDataProvider provides data about group, leaf nodes to CTreeControl. Any suggestions on what pattern shall I use? Brian
I use the Bridge pattern as described by the GOF Book for exactly this. The tree has no idea what it's data source is or what it is displayed. There is an abstract tree container class for this, and the derived class provides the tree data upon request. Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program