Design Patterns Recommendation for Filtering Option
Posted
by Tarik
on Stack Overflow
See other posts from Stack Overflow
or by Tarik
Published on 2010-03-31T06:24:48Z
Indexed on
2010/03/31
6:33 UTC
Read the original article
Hit count: 698
Hi people,
I am thinking to create a filter object which filters and delete everything like html tags from a context. But I want it to be independent which means the design pattern I can apply will help me to add more filters in the future without effecting the current codes. I thought Abstract Factory but it seems it ain't gonna work out the way I want. So maybe builder but it looks same. I don't know I am kinda confused, some one please recommend me a design pattern which can solve my problem but before that let me elaborate the problem a little bit.
Lets say I have a class which has Description field or property what ever. And I need filters which remove the things I want from this Description property. So whenever I apply the filter I can add more filter in underlying tier. So instead of re-touching the Description field, I can easily add more filters and all the filters will run for Description field and delete whatever they are supposed to delete from the Description context.
I hope I could describe my problem. I think some of you ran into the same situation before.
Thanks in advance...
© Stack Overflow or respective owner