I have an application (Legacy code)
that contains interface Icomponent
with save()
methods
and many classes that implement it.
I want to add log after every save().
I thought to
use the decorator pattern to Icomponent
with additional log()
method.
create LogService
class which is called from each decorator's log()
I think LogService
is a classic case of singelton, but I read it would be hard for unit-testing.
What would be you design to that solution?