We have a class that takes another class in the constructor and loops through all the properties on the class passed to it.
Lately it has been decided there are certain cases where different rules should apply.
Currently there is a simple method looping through all properties and performing some work. The same on each. Now that we want a slightly different approach a quick fix is needed for now.
What would be your chosen method for treating each one differently.
I realise we could quickly add a couple of if statements or a case statements to single out the oddities.
How about though and this is in theory.
We create an 'info' attribute that has some entries on it like info (describes the propertr), then some programmatical ones like process (bool value that determines if the property should be processed), then other flags can be added if needed.
The method that loops through properties can now query the attribute values and determine what action to take and then new properties just need to have the attribute added to depict control to the processing class.
What do yu guys think.