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 Applied science, practical discipli ...
, 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 program ...
. 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 sp ...
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 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 concern In aspect-oriented software development, cross-cutting concerns are aspects of a program that affect several modules, without the possibility of being encapsulated in any of them.
These concerns often cannot be cleanly decomposed from the rest ...
s.
[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, suc ...
s address the issue of
cross-cutting concern In aspect-oriented software development, cross-cutting concerns are aspects of a program that affect several modules, without the possibility of being encapsulated in any of them.
These concerns often cannot be cleanly decomposed from the rest ...
s 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 ar ...
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 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 pr ...
, describing concerns as objects
*
Functional programming
In computer science, functional programming is a programming paradigm where programs are constructed by Function application, applying and Function composition (computer science), composing Function (computer science), functions. It is a declar ...
, describing concerns as functions
*
Aspect-oriented software development
In computing, aspect-oriented programming (AOP) is a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns. It does so by adding behavior to existing code (an advice) ''without'' modifying ...
, treating concerns and their interaction as constructs of their own standing
See also
*
Cross-cutting concern In aspect-oriented software development, cross-cutting concerns are aspects of a program that affect several modules, without the possibility of being encapsulated in any of them.
These concerns often cannot be cleanly decomposed from the rest ...
*
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)
Software project management is an art and science of planning and leading software projects. It is a sub-discipline of project management in which software projects are planned, implemented, monitored and controlled.
History
In the 1970s and 1 ...
, 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