Cross-cutting concerns are functions of a program which affect other functions. Since they cannot be completely modularized in both the design and implementation, the resulting code will either be scattered throughout different modules that generate necessary data or tied to specific modules that perform dependent operations. Logging changes to the a database is an example of a cross-cutting concern since it involves checking and updating multiple tables.
Questions tagged [cross-cutting-concerns]
65 questions
175
votes
5 answers
Cross cutting concern example
What is a good example of a cross-cutting concern? The medical record example on the wikipedia page seems incomplete to me.
Specifically from this example, why would logging lead to code duplication (scattering)? (Besides simple calls such as…

jlars62
- 7,183
- 7
- 39
- 60
23
votes
2 answers
Logging as a decorator vs. Dependency Injection - what if I need to log inside the class?
(I originally asked this question in this comment, but Mark Seemann asked me to create a new question instead.)
I'm starting a new app (.NET Core, if that matters), and right now I'm trying to decide how exactly to do logging.
The general consensus…

Christian Specht
- 35,843
- 15
- 128
- 182
15
votes
3 answers
Interceptor with Microsoft.Extensions.DependencyInjection and asp.net web api 2 for cross cutting concerns like logging
We are using Microsoft.Extensions.DependencyInjection in our asp.net web api2 for dependency injection.
For cross cutting concerns like logging, we are of thought that aspect oriented programming should be considered and unable to find any support…

azharuddin irfani
- 826
- 9
- 16
8
votes
1 answer
How to handle cross cutting concerns the Scala way
I am reading online about cross cutting concerns since I just implemented Log4j into my code. Some people are saying using AspectJ is okay, while others point out that it breaks functional programming. That mixins are Scala's solution for cross…
user1187135
8
votes
2 answers
Constructor injection (DI) vs. static factories for cross cutting concerns?
In most arbitrary applications, there are many cross cutting concerns that need to be addressed among all available layers, e.g. logging, message bus, configuration. What I noticed is that in some classes, they tend to completely blow up the…

xvdiff
- 2,179
- 2
- 24
- 47
8
votes
3 answers
Threading/Ambient Context in CRM 2011 plugins
We have recently had a few occasions where the question came up whether in Dynamics CRM 2011, one plugin execution (i.e. a pass of the Execute() method) is guaranteed to stay on the same thread.
I'd like to implement tracing using the Ambient…

TeaDrivenDev
- 6,591
- 33
- 50
7
votes
1 answer
What are scattering and tangling in aop
I am trying to understand the separation of concerns used within AOP. Therefore i would appreciate if someone could explain me what does mean code scattering and code tangling in AOP using some basic HelloWorld examples. How would i know afterwards…

user-x220
- 151
- 1
- 3
- 9
7
votes
1 answer
Can we inject some more lines in a function by extending it with PHP?
I have an idea for the event system I'm developing for my custom framework.
Imagine a pseudo function like this.
class Test
{
public function hi()
{
Event::add(__FUNCTION__ . 'is about to run.');
return "hi";
}
}
Imagine…

Aristona
- 8,611
- 9
- 54
- 80
7
votes
7 answers
Does groovy provide an include mechanism?
We are searching for an include mechanism for groovy scripts to have space for cross-cutting-concerns.
In my example we have, web service endpoints as groovy scripts and want to log to our web service protocol. for that we use our implicit object…

Christopher Klewes
- 11,181
- 18
- 74
- 102
6
votes
3 answers
How should I architect logging within my application?
So I've done a lot of research on this and haven't found any answers where I said, "yes, THAT". I'm hoping the ever-erudite StackOverflow crowd can help me out.
I've run into this issue in a couple of different scenarios. Say I have a C# app, and…

JonH
- 821
- 11
- 19
5
votes
2 answers
CQRS applying cross cutting concerns such as security
Suppose I have a complex system where there large trees of people. Simple thoughts are employees / manager relationship, many employees report to one manager. Now in addition to manager there are support staff that are capable of acting on the…

Chris Marisic
- 32,487
- 24
- 164
- 258
5
votes
2 answers
Cross-cutting concerns in JAX-RS
I'm looking for a mechanism within JAX-RS (JSR-311) to allow me to distill out some of my cross-cutting concerns specific to my app. For example, my app has certain context which is looked up or built for each request. I'd like to be able to have…

mckamey
- 17,359
- 16
- 83
- 116
5
votes
2 answers
Cross Cutting Layer | Automapper | Dependency Injection
I have a MVC layered application and I have some questions about Cross Cutting layer. So far this layer has Logging, DI, Error Handling and Cache.
I created a project and put all those features separated by folder. Is this ok? Or should I create a…

Yuri Cardoso
- 113
- 1
- 13
5
votes
1 answer
ember concerns implementation
How would you implement concerns in ember. For instance, send invite functionality:
user have 5 invites (store involved from fetching data)
invite available from any application state
it appears in modal
it can be more than one more - thus {{outlet…

Kirill Salykin
- 681
- 6
- 19
4
votes
1 answer
Difference between Aspects, concerns and cross-cutting concerns in Spring AOP
Can anyone please explain the difference between Aspects, concerns and cross-cutting concerns in Spring AOP with example? I have gone through a lot of tutorial sites but I didn't get any good explanation.

Rezaul Hoque
- 43
- 3