Design patterns to avoiding breaking the SRP while performing heavy data logging

Posted by Kazark on Programmers See other posts from Programmers or by Kazark
Published on 2012-12-17T23:25:45Z Indexed on 2012/12/18 5:13 UTC
Read the original article Hit count: 376

A class that performs both computations and data logging seems to have at least two responsibilities. Given a system for which the specifications require heavy data logging, what kind of design patterns or architectural patterns can be used to avoid bloating all the classes with logging calls every time they compute something?

The decorator pattern be used (e.g. Interpolator decorated to LoggingInterpolator), but it seems that would result in a situation hardly more desirable in which almost every major class would need to be decorated with logging.

© Programmers or respective owner

Related posts about data

Related posts about patterns-and-practices