Using Aspect-Oriented Programming to Enforce Architecture
• SEI Report
Publisher
Software Engineering Institute
CMU/SEI Report Number
CMU/SEI-2007-TN-019DOI (Digital Object Identifier)
10.1184/R1/6585692.v1Topic or Tag
Abstract
Using aspect-oriented programming (AOP), software developers can define customized compile-time error or warning messages that are issued when the code contains join points that match specified pointcuts. These customized messages are generated by compile-time declarations, which are an extremely simple but powerful AOP mechanism. Declarations that look for nonvalid interactions between modules can be used for architecture enforcement. Coding policies, best practices, design patterns, and code-naming conventions can also be enforced. Compile-time declarations operate as an additional verification in the build process, but they do not affect the compiled application and can be turned on and off at any time. That feature makes this approach an automated and nondisruptive solution for architecture enforcement and a risk-free first step towards AOP adoption.
Cite This SEI Report
Merson, P. (2007, September 1). Using Aspect-Oriented Programming to Enforce Architecture. (SEI Report CMU/SEI-2007-TN-019). Retrieved August 19, 2026, from https://doi.org/10.1184/R1/6585692.v1.
@techreport{merson_2007,
author={Merson, Paulo},
title={Using Aspect-Oriented Programming to Enforce Architecture},
month={Sep},
year={2007},
number={{CMU/SEI-2007-TN-019},
institution={Software Engineering Institute, Carnegie Mellon University},
doi={10.1184/R1/6585692.v1},
url={https://doi.org/10.1184/R1/6585692.v1},
note={Accessed: 2026-Aug-19}
}
Merson, Paulo. "Using Aspect-Oriented Programming to Enforce Architecture." (CMU/SEI-2007-TN-019). Software Engineering Institute, Carnegie Mellon University. Software Engineering Institute, September 1, 2007. https://doi.org/10.1184/R1/6585692.v1.
P. Merson, "Using Aspect-Oriented Programming to Enforce Architecture," Software Engineering Institute, Carnegie Mellon University. Software Engineering Institute, SEI Report CMU/SEI-2007-TN-019, 1-Sep-2007 [Online]. Available: https://doi.org/10.1184/R1/6585692.v1. [Accessed: 19-Aug-2026].
Merson, Paulo. "Using Aspect-Oriented Programming to Enforce Architecture." (SEI Report CMU/SEI-2007-TN-019). Software Engineering Institute, Carnegie Mellon University, Software Engineering Institute, 1 Sep. 2007. https://doi.org/10.1184/R1/6585692.v1. Accessed 19 Aug. 2026.
Merson, Paulo. Using Aspect-Oriented Programming to Enforce Architecture. CMU/SEI-2007-TN-019. Software Engineering Institute. 2007. DOI: 10.1184/R1/6585692.v1. https://doi.org/10.1184/R1/6585692.v1