Concern (computer science)
![]() | This article's factual accuracy is disputed. |
This article needs additional citations for verification. (December 2006) |
This article needs additional citations for verification. (July 2007) |
In computer science, a concern is a general term that refers to any particular piece of interest or focus in a program. A non-exhaustive list of example concerns are:
- Some source code
- The implementation of a feature
- A design pattern
- A use case
- A UML diagram
- Some design documents
- Or any grouping of the above
Concerns do not exist until someone is concerned about them, i.e. an arbitrary set of source files does not constitute a concern until a programmer has some reason to be interested in all of them at once. For example, a programmer may realize that a set of source code files collectively implement a design pattern. Thereby, those source files become a concern implementing that design pattern.
Concerns are also created forwards, not retroactively. Programmers write programs in order to achieve certain goals or create features, such as credit card billing or sending email. The source code implementing these features are concerns. Note that features denote behavior itself but that concern denotes the implementation of the behavior.
Typically, the implementation of those features that is most essential to the program are the core concerns since they are core to the way the program behaves.
A concern is cross-cutting to the extent that it is scattered and tangled amongst other concerns. Cross-cutting concerns are generally considered a bad thing when creating software.
For example, when programmers simply insert calls to cross-cutting concerns (such as logging, object persistence, etc.) everywhere in the source code where needed, the resulting program leads to a highly-coupled system. Such systems can be difficult to change. Every time programmers make even a small change to one of these cross-cutting concerns, there is the danger that the change can have wide-spread ramifications to the entire program.
For this reason, Separation of concerns (SoC) forms an important goal in program design. Numerous programming paradigms have arisen to assist in SoC: