What are some design patterns that can be used with a tree control?

  • Thread starter Thread starter D
  • Start date Start date
D

D

Lets say we have a tree control with a user as the root node with child
nodes that represent test sets they subscribe to (which map directly to sql
tables) and related reports (sql stored procedures returning data viewed in
a datagrid)

list so
User
|___TestSet1
|_____Report1
|_____Report2

|___TestSet4
|_____Report8
|_____Report9

My first thoughts are to use the command pattern so that when the user
double clicks on a report the command classes Execute function is executed
which runs the stored procedure with certain parameters all of which are
stored as data members in the class.

Now lets add a twist and say that I want to create a new node type called
BatchReports which will run all the reports under it like so

User
|___TestSet1
|_____BatchReport1
|_____Report1
|_____Report2
|_____Report3

|___TestSet4
|_____BatchReport1
|_____Report7
|_____Report8
|_____Report9

so that clicking BatchReport1 will cause Reports 1, 2 & 3 to execute. Which
pattern would be good there, I guess the command pattern again and perhaps
the interpreter pattern? that might be over kill.

I'm pretty new to patterns so if anyone has some suggestions I welcome them.

Thanks
 
I forgot to add that on the BatchReports side of things there will come a
day when some of the data from report #1 will be used to source report #2.
Meaning that right now they are separate entities but as the reports become
more advanced they'll become more connected. Thus the reason why I
considered the interpreter in the first place.


Thanks
 
Back
Top