Knowledge

Separation of concerns

Source đź“ť

208:
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.
341:. Security and logging are often secondary concerns, whereas the primary concern is often on accomplishing business goals. However, when designing a program, its security must be built into the design from the beginning instead of being treated as a secondary concern. Applying security afterwards often results in an insufficient security model that leaves too many gaps for future attacks. This may be solved with aspect-oriented programming. For example, an aspect may be written to enforce that calls to a certain API are always logged, or that errors are always logged when an exception is thrown, regardless of whether the program's procedural code handles the exception or propagates it. 20: 69:
independent development. Hiding the implementation details of modules behind an interface enables improving or modifying a single concern's section of code without having to know the details of other sections and without having to make corresponding changes to those other sections. Modules can also expose different versions of an interface, which increases the freedom to upgrade a complex system in piecemeal fashion without interim loss of functionality.
301:(JS) are complementary languages used in the development of web pages and websites. HTML is mainly used for organization of webpage content, CSS is used for definition of content presentation style, and JS defines how the content interacts and behaves with the user. Historically, this was not the case: prior to the introduction of CSS, HTML performed both duties of defining semantics and style. 187:
information inside one room, such as how messy it is, is not available to the other rooms, except through the interface, which is the door. The example with circuits demonstrates that activity inside one module, which is a circuit with consumers of electricity attached, does not affect activity in a different module, so each module is not concerned with what happens in the other.
76:. As with most abstractions, separating concerns means adding additional code interfaces, generally creating more code to be executed. The extra code can result in higher computation costs in some cases, but in other cases also can lead to reuse of more optimized code. So despite the many benefits of well-separated concerns, there may be an associated execution penalty. 248:
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.
247:
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
68:
Separation of concerns results in more degrees of freedom for some aspect of the program's design, deployment, or usage. Common among these is increased freedom for simplification and maintenance of code. When concerns are well-separated, there are more opportunities for module upgrade, reuse, and
377:
separation of concerns is one of the four guiding principles. Adhering to this principle is one of the tools that helps reduce the combinatorial effects that, over time, get introduced in software that is being maintained. In normalized systems separation of concerns is actively supported by the
243:
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
186:
Common examples include separating a space into rooms, so that activity in one room does not affect people in other rooms, and keeping the stove on one circuit and the lights on another, so that overload by the stove does not turn the lights off. The example with rooms shows encapsulation, where
207:
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
312:
allows separate concerns to be addressed as separate software constructs, each on an equal footing with the others. Each concern provides its own class-structure into which the objects in common are organized, and contributes state and methods to the composite result where they cut across one
317:
allows the analysis and composition of concerns to be manipulated as a multi-dimensional "matrix" in which each concern provides a dimension in which different points of choice are enumerated, with the cells of the matrix occupied by the appropriate software artifacts.
274:. This allows protocol designers to focus on the concerns in one layer, and ignore the other layers. The Application Layer protocol SMTP, for example, is concerned about all the details of conducting an email session over a reliable transport service (usually 361:. At any given time, a researcher may be focusing on (1) what some aspect of intelligence needs to compute, (2) what algorithm it employs, or (3) how that algorithm is implemented in hardware. This separation of concerns is similar to the 183:. The goal is to more effectively understand, design, and manage complex interdependent systems, so that functions can be reused, optimized independently of other functions, and insulated from the potential failure of other functions. 313:
another. Correspondence rules describe how the classes and methods in the various concerns are related to each other at points where they interact, allowing composite behavior for a method to be derived from several concerns.
251:
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
49:, a set of information that affects the code of a computer program. A concern can be as general as "the details of the hardware for an application", or as specific as "the name of which class to 278:), but not in the least concerned about how the transport service makes that service reliable. Similarly, TCP is not concerned about the routing of data packets, which is handled at the 65:. Layered designs in information systems are another embodiment of separation of concerns (e.g., presentation layer, business logic layer, data access layer, persistence layer). 918: 374: 768: 720: 314: 832: 938: 926: 23:
Diagram illustrating the principle of separation of concerns, which says that an action entity can only contain a single type of tasks
667: 694: 125: 778: 730: 677: 358: 611: 606: 848: 816: 704: 113: 58: 957: 646: 133: 93: 73: 275: 145: 117: 101: 889: 309: 149: 121: 770:
Building Enterprise Applications with Windows Presentation Foundation and the Model View ViewModel Pattern
798: 746:
Painter, Robert Richard (2006). "Software Plans: Multi-Dimensional Fine-Grained Separation of Concerns".
621: 326: 157: 105: 89: 50: 616: 45: 165: 161: 109: 752: 61:
information inside a section of code that has a well-defined interface. Encapsulation is a means of
244:
reliable results and we can ease the programming problem by automating much of the administration.
141: 54: 354: 267: 935: 923: 808: 802: 747: 294: 137: 641: 962: 362: 330: 171:
Separation of concerns is an important design principle in many other areas as well, such as
85: 8: 636: 129: 794: 200: 180: 62: 844: 837: 812: 774: 726: 700: 673: 350: 334: 333:
to be addressed as primary concerns. For example, most programs require some form of
40: 28: 865: 942: 930: 84:
The mechanisms for modular or object-oriented programming that are provided by a
936:
Tutorial and Workshop on Aspect-Oriented Programming and Separation of Concerns
631: 279: 172: 951: 387: 19: 338: 176: 153: 266:
Separation of concerns is crucial to the design of the Internet. In the
224:
The programmer is having to do several things at the same time, namely,
216:
was becoming an accepted idea. In 1989, Chris Reade wrote a book titled
298: 270:, great efforts have been made to separate concerns into well-defined 57:
program. Modularity, and hence separation of concerns, is achieved by
271: 88:
are mechanisms that allow developers to provide SoC. For example,
365:/implementation distinction in software and hardware engineering. 126:
separate presentation and the data-processing (model) from content
344: 626: 97: 386:
Separation of concerns can be implemented and enforced via
290: 669:
What Every Engineer Should Know About Software Engineering
43:
into distinct sections. Each section addresses a separate
203:
in his 1974 paper "On the role of scientific thought".
804:
Selected writings on Computing: A Personal Perspective
231:
organise the computation sequencing into small steps;
836: 393: 234:organise memory management during the computation. 949: 53:". A program that embodies SoC well is called a 304: 807:. New York, NY, US: Springer-Verlag. pp.  321: 345:Levels of analysis in artificial intelligence 212:Fifteen years later, it was evident the term 863: 696:Managing Complexity in Software Engineering 887: 843:. Boston, MA, US: Addison-Wesley Longman. 381: 261: 751: 39:) is a design principle for separating a 16:Design principle for computer programming 919:Multi-Dimensional Separation of Concerns 793: 766: 722:Microsoft Application Architecture Guide 713: 692: 665: 357:, it is common to refer to David Marr's 315:Multi-dimensional separation of concerns 285: 18: 760: 745: 686: 659: 220:that describes separation of concerns: 950: 739: 831: 642:Orthogonality § Computer science 368: 160:languages can separate concerns into 612:Aspect-oriented software development 72:Separation of concerns is a form of 890:"Hyper/Net: MDSoC Support for .NET" 799:"On the role of scientific thought" 607:Abstraction principle (programming) 13: 839:Elements of Functional Programming 218:Elements of Functional Programming 14: 974: 912: 79: 228:describe what is to be computed; 773:. Microsoft Press. p. 18. 647:Single-responsibility principle 394:SoC via partial classes in Ruby 881: 866:"Building Secure Applications" 857: 825: 787: 1: 653: 310:Subject-oriented programming 305:Subject-oriented programming 7: 888:Tiago Dias (October 2006). 767:Garofalo, Raffaele (2011). 622:Coupling (computer science) 599: 327:Aspect-oriented programming 322:Aspect-oriented programming 256: 158:Aspect-oriented programming 148:can separate concerns into 132:can separate concerns into 108:can separate concerns into 90:object-oriented programming 10: 981: 864:Jess Nielsen (June 2006). 666:Laplante, Phillip (2007). 617:Concern (computer science) 35:(sometimes abbreviated as 725:. Microsoft Press. 2009. 291:HyperText Markup Language 190: 693:Mitchell, R. J. (1990). 528: 450: 402: 239:Reade continues to say, 382:SoC via partial classes 355:artificial intelligence 268:Internet Protocol Suite 262:Internet protocol stack 199:was probably coined by 130:Service-oriented design 958:Programming principles 331:cross-cutting concerns 295:Cascading Style Sheets 254: 237: 214:separation of concerns 210: 197:separation of concerns 138:Procedural programming 33:separation of concerns 24: 286:HTML, CSS, JavaScript 241: 222: 205: 22: 489:is not edible!" 112:, and architectural 86:programming language 637:Modular programming 941:2008-05-16 at the 929:2016-12-19 at the 795:Dijkstra, Edsger W 699:. IEE. p. 5. 375:normalized systems 369:Normalized systems 359:levels of analysis 201:Edsger W. Dijkstra 181:information design 140:languages such as 92:languages such as 63:information hiding 25: 780:978-0-7356-5092-3 732:978-0-7356-2710-9 679:978-0-8493-7228-5 351:cognitive science 970: 907: 906: 904: 903: 894: 885: 879: 878: 876: 875: 870: 861: 855: 854: 842: 829: 823: 822: 791: 785: 784: 764: 758: 757: 755: 743: 737: 736: 717: 711: 710: 690: 684: 683: 663: 595: 592: 589: 586: 583: 580: 577: 574: 571: 568: 565: 562: 559: 556: 553: 550: 547: 544: 541: 538: 535: 532: 520: 517: 514: 511: 508: 505: 504::nutrition_value 502: 499: 496: 493: 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 457: 454: 442: 439: 436: 433: 430: 427: 424: 421: 418: 415: 412: 409: 406: 41:computer program 29:computer science 980: 979: 973: 972: 971: 969: 968: 967: 948: 947: 943:Wayback Machine 931:Wayback Machine 915: 910: 901: 899: 892: 886: 882: 873: 871: 868: 862: 858: 851: 830: 826: 819: 792: 788: 781: 765: 761: 753:10.1.1.110.9227 744: 740: 733: 719: 718: 714: 707: 691: 687: 680: 664: 660: 656: 651: 602: 597: 596: 593: 590: 587: 584: 581: 578: 575: 572: 569: 566: 563: 560: 557: 554: 551: 548: 545: 542: 539: 536: 533: 530: 522: 521: 518: 515: 513:nutrition_value 512: 509: 506: 503: 500: 497: 494: 491: 488: 485: 482: 479: 476: 473: 470: 467: 464: 461: 458: 455: 452: 444: 443: 440: 437: 434: 431: 428: 425: 422: 419: 416: 413: 410: 407: 404: 399:bear_hunting.rb 396: 388:partial classes 384: 371: 347: 324: 307: 288: 264: 259: 193: 114:design patterns 82: 17: 12: 11: 5: 978: 977: 966: 965: 960: 946: 945: 933: 921: 914: 913:External links 911: 909: 908: 880: 856: 849: 824: 817: 786: 779: 759: 738: 731: 712: 705: 685: 678: 657: 655: 652: 650: 649: 644: 639: 634: 632:Modular design 629: 624: 619: 614: 609: 603: 601: 598: 546:monitor_hunger 529: 527: 526: 525:bear_hunger.rb 451: 449: 448: 447:bear_eating.rb 403: 401: 400: 395: 392: 383: 380: 370: 367: 346: 343: 323: 320: 306: 303: 287: 284: 280:Internet Layer 263: 260: 258: 255: 252:architectures. 236: 235: 232: 229: 215: 192: 189: 173:urban planning 81: 80:Implementation 78: 15: 9: 6: 4: 3: 2: 976: 975: 964: 961: 959: 956: 955: 953: 944: 940: 937: 934: 932: 928: 925: 922: 920: 917: 916: 898: 891: 884: 867: 860: 852: 850:0-201-12915-9 846: 841: 840: 834: 828: 820: 818:0-387-90652-5 814: 810: 806: 805: 800: 796: 790: 782: 776: 772: 771: 763: 754: 749: 742: 734: 728: 724: 723: 716: 708: 706:0-86341-171-1 702: 698: 697: 689: 681: 675: 672:. CRC Press. 671: 670: 662: 658: 648: 645: 643: 640: 638: 635: 633: 630: 628: 625: 623: 620: 618: 615: 613: 610: 608: 605: 604: 537:attr_accessor 524: 523: 446: 445: 398: 397: 391: 389: 379: 376: 366: 364: 360: 356: 352: 342: 340: 336: 332: 328: 319: 316: 311: 302: 300: 296: 292: 283: 281: 277: 273: 269: 253: 249: 245: 240: 233: 230: 227: 226: 225: 221: 219: 213: 209: 204: 202: 198: 188: 184: 182: 178: 174: 169: 167: 163: 159: 155: 151: 147: 143: 139: 135: 131: 127: 123: 119: 115: 111: 107: 103: 99: 95: 91: 87: 77: 75: 70: 66: 64: 60: 59:encapsulating 56: 52: 48: 47: 42: 38: 34: 30: 21: 963:Reductionism 900:. Retrieved 896: 883: 872:. Retrieved 859: 838: 833:Reade, Chris 827: 803: 789: 769: 762: 741: 721: 715: 695: 688: 668: 661: 385: 372: 348: 325: 308: 289: 265: 250: 246: 242: 238: 223: 217: 211: 206: 196: 194: 185: 177:architecture 170: 83: 71: 67: 44: 36: 32: 26: 501:respond_to? 297:(CSS), and 74:abstraction 51:instantiate 952:Categories 902:2007-09-25 874:2012-02-08 654:References 299:JavaScript 150:procedures 897:DSOA 2006 748:CiteSeerX 363:interface 195:The term 154:functions 939:Archived 927:Archived 835:(1989). 797:(1982). 600:See also 335:security 293:(HTML), 257:Examples 134:services 540::hunger 378:tools. 339:logging 329:allows 166:objects 162:aspects 110:objects 55:modular 46:concern 924:TAOSAD 847:  815:  777:  750:  729:  703:  676:  627:Holism 570:hunger 552:hunger 492:unless 477:" 432::food? 423:select 417:forest 272:layers 191:Origin 146:Pascal 104:, and 102:Delphi 893:(PDF) 869:(PDF) 809:60–66 531:class 474:raise 453:class 429:& 405:class 116:like 845:ISBN 813:ISBN 775:ISBN 727:ISBN 701:ISBN 674:ISBN 582:food 567:hunt 561:food 555:> 534:Bear 507:food 495:food 483:food 468:food 456:Bear 414:hunt 408:Bear 353:and 337:and 179:and 164:and 144:and 124:can 106:Java 594:end 591:end 588:end 576:eat 543:def 519:end 516:end 462:eat 459:def 441:end 438:end 411:def 373:In 349:In 276:TCP 152:or 122:MVP 120:or 118:MVC 98:C++ 37:SoC 27:In 954:: 895:. 811:. 801:. 573:-= 558:50 549:if 480:#{ 390:. 282:. 175:, 168:. 156:. 136:. 128:. 100:, 96:, 94:C# 31:, 905:. 877:. 853:. 821:. 783:. 756:. 735:. 709:. 682:. 585:) 579:( 564:= 510:. 498:. 486:} 471:) 465:( 435:) 426:( 420:. 142:C

Index


computer science
computer program
concern
instantiate
modular
encapsulating
information hiding
abstraction
programming language
object-oriented programming
C#
C++
Delphi
Java
objects
design patterns
MVC
MVP
separate presentation and the data-processing (model) from content
Service-oriented design
services
Procedural programming
C
Pascal
procedures
functions
Aspect-oriented programming
aspects
objects

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

↑