Information about Separation Of Concerns

In computer science, separation of concerns (SoC) is the process of breaking a computer program into distinct features that overlap in functionality as little as possible. A concern is any piece of interest or focus in a program. Typically, concerns are synonymous with features or behaviors.

SoC is a long standing idea that simply means a large problem is easier to manage if it can be broken down into pieces; particularly so if the solutions to the sub-problems can be combined to form a solution to the large problem. SoC can be supported in many ways: by process, by notation, by organization, by language mechanism and others.

All programming paradigms aid developers in the process of SoC. For example, object-oriented programming languages such as Java can separate concerns into objects, and a design pattern like MVC can separate content from presentation and data-processing (model) from content. Service-oriented design can separate concerns into services. Procedural programming languages such as C and Pascal can separate concerns into procedures. Aspect-oriented programming languages can separate concerns into aspects and objects.

Progress towards SoC is traditionally achieved through modularity and encapsulation, with the help of information hiding.

Separation of concerns is an important design principle in many other areas as well, such as urban planning, architecture and information design. The goal is to design systems so that functions can be optimized independently of other functions, so that failure of one function does not cause other functions to fail, and in general to make it easier to understand, design and manage complex interdependent systems. Common examples include using corridors to connect rooms rather than having rooms open directly into each other, and keeping the stove on one circuit and the lights on another.

Origin

The term separation of concerns was probably coined by Edsger W. Dijkstra in his 1974 paper "On the role of scientific thought"[1].

Let me try to explain to you, what to my taste is characteristic for all intelligent thinking. It is, that one is willing to study in depth an aspect of one's subject matter in isolation for the sake of its own consistency, all the time knowing that one is occupying oneself only with one of the aspects. We know that a program must be correct and we can study it from that viewpoint only; we also know that it should be efficient and we can study its efficiency on another day, so to speak. In another mood we may ask ourselves whether, and if so: why, the program is desirable. But nothing is gained --on the contrary!-- by tackling these various aspects simultaneously. It is what I sometimes have called "the separation of concerns", which, even if not perfectly possible, is yet the only available technique for effective ordering of one's thoughts, that I know of. This is what I mean by "focusing one's attention upon some aspect": it does not mean ignoring the other aspects, it is just doing justice to the fact that from this aspect's point of view, the other is irrelevant. It is being one- and multiple-track minded simultaneously.


15 years later, it was evident the term Separation of Concerns was becoming an accepted idea. In 1989, Chris Reade wrote a book titled "Elements of Functional Programming" [2] that describes separation of concerns:

The programmer is having to do several things at the same time, namely, 1. describe what is to be computed; 2. organise the computation sequencing into small steps; 3. organise memory management during the computation.


Reade continues to say,

Ideally, the programmer should be able to concentrate on the first of the three tasks (describing what is to be computed) without being distracted by the other two, more administrative, tasks. Clearly, administration is important but by separating it from the main task we are likely to get more reliable results and we can ease the programming problem by automating much of the administration.

The separation of concerns has other advantages as well. For example, program proving becomes much more feasible when details of sequencing and memory management are absent from the program. Furthermore, descriptions of what is to be computed should be free of such detailed step-by-step descriptions of how to do it if they are to be evaluated with different machine architectures. Sequences of small changes to a data object held in a store may be an inappropriate description of how to compute something when a highly parallel machine is being used with thousands of processors distributed throughout the machine and local rather than global storage facilities.

Automating the administrative aspects means that the language implementor has to deal with them, but he/she has far more opportunity to make use of very different computation mechanisms with different machine architectures.

Examples

eXtensible HyperText Markup Language and Cascading Style Sheets are languages intended to separate style from content. Where XHTML elements define the abstract structure of a document, CSS directives are interpreted by the web browser to render those elements in visual form. In practice, one must sometimes alter XHTML in order to obtain the desired result with CSS, in part because style and content are not completely orthogonalized by any existing browser implementation of CSS, and in part because CSS does not allow one to remap the document tree. This particular problem can be avoided by using XML instead of XHTML and XSL instead of CSS - XSL does allow remapping the XML tree in arbitrary ways.

Aspect-oriented programming allows cross-cutting concerns to be addressed as secondary concerns. For example, most programs require some form of security and logging. Security and logging are often secondary concerns, whereas the primary concern is often on accomplishing business goals.

Most project organization tasks are seen as secondary tasks. For example, build automation is an approach to automating the process of compiling source code into binary code. The primary goals in build automation are reducing the risk of human error and saving time.

References

1. ^ Dijkstra, Edsger W. (1982), "On the role of scientific thought", in Dijkstra, Edsger W., Selected writings on Computing: A Personal Perspective, New York, NY, USA: Springer-Verlag New York, Inc. , pp. 60–66 , ISBN 0-387-90652-5
2. ^ Reade, Chris (1989). Elements of Functional Programming. Boston, MA, USA: Addison-Wesley Longman Publishing Co., Inc., 600 pages. ISBN 0201129159. 

See also

External references

Computer science, or computing science, is the study of the theoretical foundations of information and computation and their implementation and application in computer systems.
..... Click the link for more information.
A computer program is one or more instructions that are intended for execution by a computer. Specifically, it is a symbol or combination of symbols forming an algorithm that may or may not terminate, and that algorithm is written in a programming language.
..... Click the link for more information.
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

..... Click the link for more information.
Feature may refer to:
  • Feature (archaeology), any dug, built, or dumped evidence of human activity
  • Feature (Computer vision), could be an edge, corner or blob
  • Feature (CAD), could be a hole, pocket, or notch

..... Click the link for more information.
A programming paradigm is a fundamental style of programming regarding how solutions to problems are to be formulated in a programming language. (Compare with a methodology, which is a style of solving specific software engineering problems).
..... Click the link for more information.
Object-oriented programming (OOP) is a programming paradigm that uses "objects" and their interactions to design applications and computer programs. It is based on several techniques, including inheritance, modularity, polymorphism, and encapsulation.
..... Click the link for more information.
Java

Paradigm: Object-oriented, structured, imperative
Appeared in: 1995
Designed by: Sun Microsystems
Typing discipline: Static, strong, safe, nominative
Major implementations: Numerous
Influenced by: Objective-C, C++, Smalltalk, Eiffel,[1]
..... Click the link for more information.
In the programming paradigm of object-oriented programming, an object is the individual run-time unit that is used as the basic building block of programs. These objects act on each other, as opposed to a traditional view in which a program may be seen as a collection of functions,
..... Click the link for more information.
In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code.
..... Click the link for more information.
Model-view-controller (MVC) is an architectural pattern used in software engineering. In complex computer applications that present a large amount of data to the user, a developer often wishes to separate data (model) and user interface (view) concerns, so that changes to
..... Click the link for more information.
Separation of presentation and content (or "separate content from presentation") is common idiom, a design philosophy, and a methodology applied in the context of various publishing technology disciplines, including information retrieval, template processing, web design, web
..... Click the link for more information.
Service-orientation is a design paradigm that specifies the creation of automation logic in the form of services. It is applied as a strategic goal in developing a service-oriented architecture (SOA).
..... Click the link for more information.
service refers to a discretely defined set of contiguous and autonomous business or technical functionality.

OASIS (organization) defines service as "a mechanism to enable access to one or more capabilities, where the access is provided using a prescribed interface and is
..... Click the link for more information.
Procedural programming is sometimes used as a synonym for imperative programming (specifying the steps the program must take to reach the desired state), but can also refer (as in this article) to a programming paradigm based upon the concept of the procedure call.
..... Click the link for more information.
C

The C Programming Language, Brian Kernighan and Dennis Ritchie, the original edition that served for many years as an informal specification of the language.
..... Click the link for more information.
Pascal is a structured imperative computer programming language, developed in 1970 by Niklaus Wirth as a language particularly suitable for structured programming. A derivative known as Object Pascal was designed for object oriented programming.
..... Click the link for more information.
In computer science, a subroutine (function, method, procedure, or subprogram) is a portion of code within a larger program, which performs a specific task and can be relatively independent of the remaining code.
..... Click the link for more information.
In software engineering, the programming paradigms of aspect-oriented programming (AOP), and aspect-oriented software development (AOSD) attempt to aid programmers in the separation of concerns, specifically cross-cutting concerns, as an advance in
..... Click the link for more information.
In computer science, an aspect is a part of a program that cross-cuts its core concerns, therefore violating its separation of concerns. For example, logging code can cross-cut many modules, yet the aspect of logging should be separate from the functional concerns of the module it
..... Click the link for more information.
In the programming paradigm of object-oriented programming, an object is the individual run-time unit that is used as the basic building block of programs. These objects act on each other, as opposed to a traditional view in which a program may be seen as a collection of functions,
..... Click the link for more information.
Modularity is a concept that has applications in the contexts of computer science, particularly programming, as well as cognitive science in investigating the structure of mind.
..... Click the link for more information.
In computer science, the principle of information hiding is the hiding of design decisions in a computer program that are most likely to change, thus protecting other parts of the program from change if the design decision is changed.
..... Click the link for more information.
Urban, city, or town planning is the discipline of land use planning which explores several aspects of the built and social environments of municipalities and communities.
..... Click the link for more information.
Architecture is the art and science of designing buildings and structures. A wider definition often includes the design of the total built environment: from the macrolevel of town planning, urban design, and landscape architecture to the microlevel of construction details and,
..... Click the link for more information.
Information design has been defined as the art and science of preparing information so that it can be used by human beings with efficiency and effectiveness.[1]
..... Click the link for more information.
Edsger Wybe Dijkstra

Born May 11 1930(1930--)
Rotterdam, Netherlands
Died July 6 2002 (aged 72)
Nuenen, Netherlands
..... Click the link for more information.
XHTML

File extension: .xhtml, .xht, .html, .
..... Click the link for more information.
Cascading Style Sheets

File extension: .css
MIME type: text/css
Developed by: World Wide Web Consortium
Type of format: Stylesheet language
Standard(s): Level 1 (Recommendation)
Level 2 (Recommendation)
..... Click the link for more information.
XHTML

File extension: .xhtml, .xht, .html, .
..... Click the link for more information.
Cascading Style Sheets

File extension: .css
MIME type: text/css
Developed by: World Wide Web Consortium
Type of format: Stylesheet language
Standard(s): Level 1 (Recommendation)
Level 2 (Recommendation)
..... Click the link for more information.


This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.
Herod_Archelaus


page counter