I was wondering if anyone had a possible solution to the following problem... I have a base class that a series of derived classes will inherit from. The base class cares about whether properties on the derived class have changed. This is to set up an "IsDirty" approach for a data transfer object.
The traditional approach would be to set an IsDirty boolean flag declared in the base class. I was hoping to avoid this somehow, and was wondering if there might be another approach? I am concerned about a developer not remembering to set the flag in the equivalent set operation on a property in the derived class. I had considered the idea of creating a generic "SetProperty" method that would take the property name and value, but thought that there might be something more elegant.
Just as a side note, ideas regarding using reflection are not a problem. Regardless of the expense of reflection, I would like to prove out a way to do it and work on refining it further on down the road.