I am developing an application in which one part is a logging mechanism. I have defined a business logic when in every setter of each class an event is raised with the reference to the object that was changed and old value of the changed attribute. I have created a class called Logger
that listens to that events and creates a log.
But, I don't want to have a event handler for each of the events. I would like the Logger
to catch events, which parameters is an interface, let's call it 'Logging'. So from Logger's
point of view, the logging would be unified.
The question is, how to use this Logging
interface. I don't want my business classes to implement it. Could you give me some ideas what would be the best approach to do this in a nice OO design?
Thank you.