Cross-cutting concern
A cross-cutting concern is a software responsibility or behavior that affects multiple components, features, or architectural layers rather than belonging to one alone.
ASP.NET Core in Action, 3e
A cross-cutting concern is application behavior that applies across many or all request paths and features rather than one specific resource.
- How it is used
- Uses middleware to provide behavior required across multiple request paths and application layers.
- How deep it goes
- Explains pipeline flow, request modification, response handling, short-circuiting, and middleware-versus-filter scope.
- Examples
- Uses logging, security headers, user association, request language, exception handling, and permission checks as examples.
- What you can do after
- Evaluate whether middleware or filters better fit a cross-cutting behavior’s required scope and framework access.
Read how ASP.NET Core in Action, 3e explains cross-cutting concern →
Spring Microservices in Action
A cross-cutting concern is an application behavior or policy that applies across multiple services or components.
- How it is used
- Centralizes shared service policies at a gateway rather than repeating them in each service.
- How deep it goes
- Explains implementation trade-offs and the roles of pre-, route, and post-filters, without detailing filter code.
- Examples
- Illustrates header and authentication checks, response logging, and routing beta customers to a different service cluster.
- What you can do after
- Evaluate whether a gateway can centralize policies for calls routed through it.
Read how Spring Microservices in Action explains cross-cutting concern →
The Joy of JavaScript
Cross-cutting behavior is behavior that affects multiple parts of a program and is not naturally localized to a single module or class.
- How it is used
- Uses metaprogramming to separate behavior such as logging, tracing, and performance tracking from application logic.
- How deep it goes
- Defines the concern and demonstrates runtime interception with Proxy, Reflect, and before-and-after decorators.
- Examples
- Demonstrates argument validation around Counter methods, with invalid input raising RangeError.
- What you can do after
- Apply JavaScript Proxy and Reflect to intercept methods and add validation before calls or process results afterward.
Read how The Joy of JavaScript explains cross-cutting concern →
Microservices Patterns, Second Edition
A cross-cutting concern is an architectural concern that affects multiple services or components rather than a single service.
- How it is used
- Reduce duplicated, error-prone implementation of concerns required by each microservice.
- How deep it goes
- Defines the problem and recommends a service template and chassis, while deferring detailed pattern treatment.
- Examples
- Names health checks, log aggregation, distributed tracing, exception tracking, metrics, audit logging, and Maven or Gradle build logic.
- What you can do after
- Apply a service template built on a microservice chassis to start services without reimplementing shared concerns.
Read how Microservices Patterns, Second Edition explains cross-cutting concern →
Grokking Software Architecture
A software responsibility that spans multiple architectural layers rather than belonging to just one.
- How it is used
- Handles technical responsibilities needed across multiple application layers without assigning them to one horizontal layer.
- How deep it goes
- Defines the concept and explains injected dependencies, implementation swapping, fake-based tests, and AOP as an advanced alternative.
- Examples
- Uses logging, authentication, caching, error handling, house utilities, and an OrderService with replaceable or fake loggers.
- What you can do after
- Evaluate how injected shared services keep business logic focused, replaceable, and testable.
Read how Grokking Software Architecture explains cross-cutting concern →
Effective Behavior-Driven Development
A concern, such as logging or timing, that affects multiple parts of a software system rather than one isolated operation.
- How it is used
- Centralizes logging and timing that would otherwise recur across REST API test-driver methods.
- How deep it goes
- Traces repeated logging and timing into shared TestAction execution, with derived-class and lambda-backed implementations.
- Examples
- Contrasts duplicated driver logging and timing with login and registration actions invoked from step definitions.
- What you can do after
- Apply the Test Action pattern to wrap driver actions with shared logging, timing, and exception handling.
Read how Effective Behavior-Driven Development explains cross-cutting concern →
Also covered in
- Platform Engineering on Kubernetes
- Clean Applications with Hexagonal ArchitectureIn early access (MEAP)
- Context EngineeringIn early access (MEAP)
- .NET MAUI in Action
What to know first
- loggingLogging is the practice of recording events and diagnostic information produced during software or system activity for later inspection, analysis, or troubleshooting.
- microservice architectureMicroservice architecture is a software architectural style that structures an application as independently deployable services, typically organized around focused capabilities and communicating through defined interfaces.
- authenticationAuthentication is the process of verifying the claimed identity of a user, service, device, or other entity.
- entityAn entity is a distinct, identifiable object, concept, participant, or record represented in a system's model or data.
Related concepts
- aspect-oriented programmingused by · Aspect-oriented programming is a technique that modularizes cross-cutting behavior and applies it to existing code at specified join points.
- handleruses · A software component that responds to an input by performing the processing or platform-specific actions associated with it.
- layered architecturecontrasts with · Layered architecture is a software organization pattern that separates responsibilities into ordered layers with defined roles and constrained dependencies, typically from higher-level layers to lower-level ones.
- n-tier architecturecontrasts with · N-tier architecture organizes an application into distinct tiers with separate responsibilities and defined interactions, which may be logical divisions or separately deployed components.
- API gatewayaddressed by · An API gateway is a server-side intermediary that provides an entry point for client requests to backend APIs or services and routes or mediates those requests.
- securityincludes · Security is the protection of systems, information, and resources against unauthorized access, use, disclosure, alteration, disruption, or destruction.
Questions about cross-cutting concern
What is cross-cutting concern?
A cross-cutting concern is a software responsibility or behavior that affects multiple components, features, or architectural layers rather than belonging to one alone.
Which Manning books explain cross-cutting concern?
ASP.NET Core in Action, 3e, Spring Microservices in Action, The Joy of JavaScript, Microservices Patterns, Second Edition, Grokking Software Architecture and Effective Behavior-Driven Development.
What should I know before learning cross-cutting concern?
Manning books that teach cross-cutting concern usually introduce logging, microservice architecture, authentication and entity first.
What is the difference between cross-cutting concern and layered architecture?
A cross-cutting concern is a software responsibility or behavior that affects multiple components, features, or architectural layers rather than belonging to one alone. Layered architecture is a software organization pattern that separates responsibilities into ordered layers with defined roles and constrained dependencies, typically from higher-level layers to lower-level ones.
What kinds of cross-cutting concern are there?
Kinds of cross-cutting concern include security.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.





