What are the different methods for injecting cross-cutting concerns?
Posted
by Stacy Vicknair
on Stack Overflow
See other posts from Stack Overflow
or by Stacy Vicknair
Published on 2009-11-10T15:53:46Z
Indexed on
2010/05/19
5:40 UTC
Read the original article
Hit count: 222
What are the different methods for injecting cross-cutting concerns into a class so that I can minimize the coupling of the classes involved while keeping the code testable (TDD or otherwise)?
For example, consider if I have a class that requires both logging functionality and centralized exception management. Should I use DIP and inject both required concerns via an interface into the class that requires them? Should I use a service locater that I pass to each class that will require some cross cutting functionality? Is there a different solution altogether? Am I asking the wrong question entirely?
© Stack Overflow or respective owner