I guess most of us have to deal with this at some point, so I thought I would ask a question.
When you have many collections in your BLL, and you find that you are repeating the same old inline (anonymous) predicates over and over again, there is clearly encapsulation there, but what's the best way to achieve this?
In the project I'm working on now, it takes age, answer all, the class’s static approach (like the user class and the static UserPredicates class), but it seems a bit heavy and a little cop.
I work in C # mainly, so keeping in that context would be very useful, but I think this is a fairly general question to guarantee listening to other languages.
I also expect that there will be a difference in how this can be achieved with the advent of LINQ and Lambdas, so I would be interested to know how this can be done in both .Net2.0 and 3.0 / 3.5 styles.
Thanks in advance.
source
share