Cross-cutting concern

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In computer science, cross-cutting concerns are aspects of a program that affect other concerns. These concerns often cannot be cleanly decomposed from the rest of the system in both the design and implementation, and can result in either scattering (code duplication), tangling (significant dependencies between systems), or both.

For instance, if writing an application for handling medical records, the indexing of such records is a core concern, while logging a history of changes to the record database or user database, or an authentication system, would be cross-cutting concerns since they touch more parts of the program.

Background[edit]

Cross-cutting concerns are parts of a program that rely on or must affect many other parts of the system. They form the basis for the development of aspects.[1] Such cross-cutting concerns do not fit cleanly into object-oriented programming or procedural programming.[2]

Cross-cutting concerns can be directly responsible for tangling, or system inter-dependencies, within a program. Because procedural and functional language constructs consist entirely of procedure calling, there is no semantic through which two goals (the capability to be implemented and the related cross-cutting concern) can be addressed simultaneously.[3] As a result, the code addressing the cross-cutting concern must be scattered, or duplicated, across the various related locations, resulting in a loss of modularity.[2]

Aspect-oriented programming aims to encapsulate cross-cutting concerns into aspects to retain modularity. This allows for the clean isolation and reuse of code addressing the cross-cutting concern.[4] By basing designs on cross-cutting concerns, software engineering benefits are effected, including modularity and simplified maintenance.[5]

Examples[edit]

Examples of concerns that tend to be cross-cutting include:

See also[edit]

References[edit]

  1. ^ U.S. Patent 6467086, p.4
  2. ^ a b Kiczales, p.1
  3. ^ Kiczales, p.6
  4. ^ Kiczales, p.2
  5. ^ Li, p.1

Bibliography[edit]

Further reading[edit]

  • Laddad, R. (2003): AspectJ in Action, Practical Aspect-Oriented Programming, Manning Publications Co.

External links[edit]