• Post Reply Bookmark Topic Watch Topic
  • New Topic

Which design pattern can be appied here?  RSS feed

 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somthing like this TableModel --> dataFilter --> table1 table2 table 3

In a word, when set different condition in the dataFilter, it will have differnet tables. I think there is some design pattern can be appied here to make the design easily.

Thanks.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please elaborate on the requirement?
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK
The original design like this: data----model-----table
When the datafilter is apppied, data = getFromServer(filter), then the model firetableChanged, the table refreshed.
Now the requirment is build several tables based on the filter. In this case, to get the data again will make all the tables change. What I want is some design patterns can be applied here, so I can use leatest code to accomplish it.
Thank you Ilja.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you want to have different views on the same data, with some filters applied?

The first sounds like vanilla MVC to me. The latter could be implemented using Decorators.
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah! It's Decarator!
Thank you!
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome! If just every question was so easy to answer...
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ilja Preuss:
You're welcome! If just every question was so easy to answer...


...we might not neet Ilja here
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!