In
computer science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includin ...
, a concern is a particular set of information that has an effect on the code of a
computer program
A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components.
A computer progra ...
. A concern can be as general as the details of
database
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases spa ...
interaction or as specific as performing a primitive calculation, depending on the level of conversation between developers and the program being discussed.
IBM uses the term ''concern space'' to describe the sectioning of conceptual information.
Overview
Usually the code can be separated into logical sections, each addressing separate concerns, and so it hides the need for a given section to know particular information addressed by a different section. This leads to a
modular
Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a s ...
program.
Edsger W. Dijkstra
Edsger Wybe Dijkstra ( ; ; 11 May 1930 – 6 August 2002) was a Dutch computer scientist, programmer, software engineer, systems scientist, and science essayist. He received the 1972 Turing Award for fundamental contributions to developing progra ...
coined the term "
separation of concerns
In computer science, separation of concerns is a design principle for separating a computer program into distinct sections. Each section addresses a separate '' concern'', a set of information that affects the code of a computer program. A concern ...
" to describe the mentality behind this modularization, which allows the programmer to reduce the complexity of the system being
designed. Two different concerns that intermingle in the same section of code are called "
highly coupled". Sometimes the chosen module divisions do not allow for one concern to be completely separated from another, resulting in
cross-cutting concerns.
[Mendhekar, Anurag, Gregor Kiczales, and John Lamping]
"RG: A Case-Study For Aspect-Oriented Programming"
Xerox Palo Alto Research Center. Feb 1997. The various
programming paradigm
Programming paradigms are a way to classify programming languages based on their features. Languages can be classified into multiple paradigms.
Some paradigms are concerned mainly with implications for the execution model of the language, s ...
s address the issue of
cross-cutting concerns to different degrees.
Data logging
A data logger (also datalogger or data recorder) is an electronic device that records data over time or about location either with a built-in instrument or sensor or via external instruments and sensors. Increasingly, but not entirely, they a ...
is a common cross-cutting concern, being used in many other parts of the program other than the particular module(s) that actually log the data. Since changes to the logging code can affect other sections,{{How, date=September 2015 it could introduce
bugs
Bugs may refer to:
* Plural of bug
Arts, entertainment and media Fictional characters
* Bugs Bunny, a character
* Bugs Meany, a character in the ''Encyclopedia Brown'' books
Films
* ''Bugs'' (2003 film), a science-fiction-horror film
* ''Bugs ...
in the operation of the program.
Paradigms that specifically address the issue of concern separation:
*
Object-oriented programming
Object-oriented programming (OOP) is a programming paradigm based on the concept of " objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of ...
, describing concerns as objects
*
Functional programming
In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that ...
, describing concerns as functions
*
Aspect-oriented software development, treating concerns and their interaction as constructs of their own standing
See also
*
Cross-cutting concern
*
Separation of concerns
In computer science, separation of concerns is a design principle for separating a computer program into distinct sections. Each section addresses a separate '' concern'', a set of information that affects the code of a computer program. A concern ...
*
Issue (computers), a unit of work to accomplish an improvement in a data system
References
External links
Concerns in Rails, by DHH, the Rails creator
Software engineering terminology