Knowledge (XXG)

Mediator pattern

Source 📝

161:
The essence of the mediator pattern is to "define an object that encapsulates how a set of objects interact". It promotes loose coupling by keeping objects from referring to each other explicitly, and it allows their interaction to be varied independently. Client classes can use the mediator to send
682:
A chat room could use the mediator pattern, or a system where many ‘clients’ each receive a message each time one of the other clients performs an action (for chat rooms, this would be when each person sends a message). In reality using the mediator pattern for a chat room would only be practical
120:
Defining a set of interacting objects by accessing and updating each other directly is inflexible because it tightly couples the objects to each other and makes it impossible to change the interaction independently from (without having to change) the objects. And it stops the objects from being
1164:
objects, forcing the user code to access the stored values through the mediator. When a storage object wants to emit an event indicating that its value has changed, it also goes back to the mediator object (via the method
69:
between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes.
387:, such that they do not call each other explicitly, but instead do so through calls to a mediator. In the following example, the mediator registers all Components and then calls their SetState methods. 93:
that describe how to solve recurring design problems to design flexible and reusable object-oriented software, that is, objects that are easier to implement, change, test, and reuse.
77:. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby reducing 2198: 176: 2361: 688: 311: 35: 2886: 2241: 2994: 2911: 2263: 2182: 2684: 2859: 2483: 78: 2667: 2577: 2707: 2326: 2677: 2672: 2354: 143:
The objects interact with each other indirectly through a mediator object that controls and coordinates the interaction.
2952: 2790: 2567: 2775: 2770: 2597: 2815: 2780: 2747: 2397: 2347: 46: 2612: 2717: 2689: 2627: 2592: 2528: 2370: 2145: 127:
are hard to implement, change, test, and reuse because they refer to and know about many different objects.
175: 162:
messages to other clients, and can receive messages from other clients via an event on the mediator class.
2694: 2622: 2572: 2407: 206:), which makes them independent from one another with respect to how the interaction is carried out. The 2973: 2876: 2722: 2702: 2647: 150:. They only refer to and know about their mediator object and have no explicit knowledge of each other. 139:
Objects delegate their interaction to a mediator object instead of interacting with each other directly.
57:
are distributed among these classes. However, as more classes are added to a program, especially during
2785: 2742: 2737: 2727: 2637: 58: 27: 2825: 2810: 2805: 2662: 2547: 2493: 2947: 2926: 2835: 2732: 2582: 2475: 2427: 2389: 2192: 39: 136:
Define a separate (mediator) object that encapsulates the interaction between a set of objects.
2617: 2460: 2450: 2445: 2417: 2412: 2259: 2178: 2174: 2167: 2916: 2657: 2602: 2523: 2513: 2498: 1170: 225: 198:
classes do not refer to (and update) each other directly. Instead, they refer to the common
2906: 2852: 2830: 2607: 2562: 2533: 2508: 2488: 2435: 2402: 2378: 2250: 2137: 384: 90: 310: 2891: 2752: 2455: 2440: 2331: 2255: 2245: 2131: 116:
It should be possible to change the interaction between a set of objects independently.
50: 17: 2988: 2712: 2557: 2518: 2465: 187: 66: 2968: 2931: 2820: 2795: 2587: 2279: 73:
With the mediator pattern, communication between objects is encapsulated within a
2921: 2896: 2881: 2800: 2632: 2237: 62: 54: 2298: 2213: 2142:
the book which gave rise to the study of design patterns in computer science
2901: 691: 2339: 336:- implements the mediator interface and coordinates communication between 684: 179:
A sample UML class and sequence diagram for the mediator design pattern.
113:
Tight coupling between a set of interacting objects should be avoided.
2214:"The Mediator design pattern - Problem, Solution, and Applicability" 232:
object mediates (controls and coordinates) the interaction between
694:(people subscribed to the Mediator class’ MessageReceived event). 309: 174: 89:
The mediator design pattern is one of the twenty-three well-known
38:
how a set of objects interact. This pattern is considered to be a
2165:
Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides (1994).
1169:) that controls the list of the observers (implemented using the 363:- implements the Colleague interface and communicates with other 2343: 45:
In object-oriented programming, programs often consist of many
2169:
Design Patterns: Elements of Reusable Object-Oriented Software
222: 184: 42:
due to the way it can alter the program's running behavior.
2299:"The Mediator design pattern - Structure and Collaboration" 2148:, a standard solution to common problems in software design 344:
and their purposes with regards to inter-communication.
202:
interface for controlling and coordinating interaction (
350:- defines the interface for communication with other 228:
shows the run-time interactions. In this example, a
2961: 2940: 2869: 2844: 2761: 2646: 2546: 2474: 2426: 2388: 2377: 153:See also the UML class and sequence diagram below. 97:
Problems that the mediator design pattern can solve
2166: 326:- defines the interface for communication between 131:Solutions described by the mediator design pattern 383:The mediator pattern ensures that components are 251:(to update/synchronize its state, for example), 2327:"Is the use of the mediator pattern recommend?" 1068:"{0} received '{1}' from {2}" 2355: 8: 2197:: CS1 maint: multiple names: authors list ( 687:. Using raw sockets would not allow for the 2385: 2362: 2348: 2340: 825:"Sending '{0}' from {1}" 1199:java.util.concurrent.CopyOnWriteArrayList 290:object, which gets the changed data from 263:object, which gets the changed data from 210:class implements the interaction between 2157: 314:The mediator behavioural design pattern 2190: 1160:object controls the values of several 121:reusable and makes them hard to test. 7: 23:Software architecture design pattern 340:objects. It is aware of all of the 14: 2860:Enterprise Integration Patterns 171:UML class and sequence diagram 1: 2048:"new age for bob: " 1156:In the following example, a 536:// Mediates the common tasks 2953:Portland Pattern Repository 2325:Kaiser, Bodo (2012-09-21). 2173:. Addison Wesley. pp.  1991:"age for alice: " 1208:java.util.function.Consumer 990:MessageReceivedEventHandler 750:MessageReceivedEventHandler 708:MessageReceivedEventHandler 3011: 15: 2280:"Mediator Design Pattern" 2995:Software design patterns 2578:Event-based asynchronous 2371:Software design patterns 1175: 696: 389: 16:Not to be confused with 2484:Chain of responsibility 2146:Software design pattern 524:NotImplementedException 467:NotImplementedException 247:wants to interact with 146:This makes the objects 125:Tightly coupled objects 34:defines an object that 2623:Scheduled-task pattern 2573:Double-checked locking 315: 180: 2974:Architectural pattern 2877:Christopher Alexander 313: 178: 2786:Dependency injection 2743:Inversion of control 2738:Data transfer object 2638:Thread-local storage 1454:CopyOnWriteArrayList 1427:CopyOnWriteArrayList 28:software engineering 2791:Intercepting filter 2948:The Hillside Group 2733:Data access object 2583:Guarded suspension 2568:Binding properties 1190:java.util.Optional 316: 181: 40:behavioral pattern 2982: 2981: 2776:Business delegate 2708:Publish–subscribe 2542: 2541: 2297:Franke, GĂźnther. 2240:; Helm, Richard; 2212:Franke, GĂźnther. 1955:"alice" 1931:"alice" 1181:java.util.HashMap 361:ConcreteColleague 65:, the problem of 3002: 2781:Composite entity 2658:Front controller 2398:Abstract factory 2386: 2364: 2357: 2350: 2341: 2336: 2313: 2312: 2310: 2309: 2294: 2288: 2287: 2276: 2270: 2269: 2234: 2228: 2227: 2225: 2224: 2209: 2203: 2202: 2196: 2188: 2172: 2162: 2121: 2118: 2115: 2112: 2109: 2106: 2103: 2100: 2097: 2094: 2091: 2088: 2085: 2082: 2079: 2078:RuntimeException 2076: 2073: 2070: 2067: 2064: 2061: 2058: 2055: 2052: 2049: 2046: 2043: 2040: 2037: 2034: 2031: 2028: 2025: 2022: 2019: 2016: 2013: 2010: 2007: 2004: 2001: 1998: 1995: 1992: 1989: 1986: 1983: 1980: 1977: 1974: 1971: 1968: 1965: 1962: 1959: 1956: 1953: 1950: 1947: 1944: 1941: 1938: 1935: 1932: 1929: 1926: 1923: 1920: 1917: 1914: 1911: 1908: 1905: 1902: 1899: 1896: 1893: 1890: 1887: 1884: 1881: 1878: 1875: 1872: 1869: 1866: 1863: 1860: 1857: 1854: 1851: 1848: 1845: 1842: 1839: 1836: 1833: 1830: 1827: 1824: 1821: 1818: 1815: 1812: 1809: 1806: 1803: 1800: 1797: 1794: 1791: 1788: 1785: 1782: 1779: 1776: 1773: 1770: 1767: 1764: 1761: 1758: 1755: 1752: 1749: 1746: 1743: 1740: 1737: 1734: 1731: 1728: 1725: 1722: 1719: 1716: 1713: 1710: 1707: 1704: 1701: 1698: 1695: 1692: 1689: 1686: 1683: 1680: 1677: 1674: 1671: 1668: 1665: 1662: 1659: 1656: 1653: 1650: 1647: 1644: 1641: 1638: 1635: 1632: 1629: 1626: 1623: 1620: 1617: 1614: 1611: 1608: 1605: 1602: 1599: 1596: 1593: 1590: 1587: 1584: 1581: 1578: 1575: 1572: 1569: 1566: 1563: 1560: 1557: 1554: 1551: 1548: 1545: 1542: 1539: 1536: 1533: 1530: 1527: 1524: 1521: 1518: 1515: 1512: 1509: 1506: 1503: 1500: 1497: 1494: 1491: 1488: 1485: 1482: 1479: 1476: 1473: 1470: 1467: 1464: 1461: 1458: 1455: 1452: 1449: 1446: 1443: 1440: 1437: 1434: 1431: 1428: 1425: 1422: 1419: 1416: 1413: 1410: 1407: 1404: 1401: 1398: 1395: 1392: 1389: 1386: 1383: 1380: 1377: 1374: 1371: 1368: 1365: 1362: 1359: 1356: 1353: 1350: 1347: 1344: 1341: 1338: 1335: 1332: 1329: 1326: 1323: 1320: 1317: 1314: 1311: 1308: 1305: 1302: 1299: 1296: 1293: 1290: 1287: 1284: 1281: 1278: 1275: 1272: 1269: 1266: 1263: 1260: 1257: 1254: 1251: 1248: 1245: 1242: 1239: 1236: 1233: 1230: 1227: 1224: 1221: 1218: 1215: 1212: 1209: 1206: 1203: 1200: 1197: 1194: 1191: 1188: 1185: 1182: 1179: 1171:observer pattern 1168: 1163: 1159: 1147: 1144: 1141: 1138: 1135: 1132: 1129: 1126: 1123: 1120: 1117: 1114: 1111: 1108: 1105: 1102: 1099: 1096: 1093: 1090: 1087: 1084: 1081: 1078: 1075: 1072: 1069: 1066: 1063: 1060: 1057: 1054: 1051: 1048: 1045: 1042: 1039: 1036: 1033: 1030: 1027: 1024: 1021: 1018: 1015: 1012: 1009: 1006: 1003: 1000: 997: 994: 991: 988: 985: 982: 979: 976: 973: 970: 967: 964: 961: 958: 955: 952: 949: 946: 943: 940: 937: 934: 931: 928: 925: 922: 919: 916: 913: 910: 907: 904: 901: 898: 895: 892: 889: 886: 883: 880: 877: 874: 871: 868: 865: 862: 859: 856: 853: 850: 847: 844: 841: 838: 835: 832: 829: 826: 823: 820: 817: 814: 811: 808: 805: 802: 799: 796: 793: 790: 787: 784: 781: 778: 775: 772: 769: 766: 763: 760: 757: 754: 751: 748: 745: 742: 739: 736: 733: 730: 727: 724: 721: 718: 715: 712: 709: 706: 703: 700: 678: 675: 672: 669: 666: 663: 660: 657: 654: 651: 648: 645: 642: 639: 636: 633: 630: 627: 624: 621: 618: 615: 612: 609: 606: 603: 600: 597: 594: 591: 588: 585: 582: 579: 576: 573: 570: 567: 564: 561: 558: 555: 552: 549: 546: 543: 540: 537: 534: 531: 528: 525: 522: 519: 516: 513: 510: 507: 504: 501: 498: 495: 492: 489: 486: 483: 480: 477: 474: 471: 468: 465: 462: 459: 456: 453: 450: 447: 444: 441: 438: 435: 432: 429: 426: 423: 420: 417: 414: 411: 408: 405: 402: 399: 396: 393: 334:ConcreteMediator 301: 297: 294:and performs an 293: 289: 285: 281: 274: 270: 267:and performs an 266: 262: 258: 254: 250: 246: 239: 235: 231: 226:sequence diagram 217: 213: 209: 205: 201: 197: 193: 109: 108: 104: 32:mediator pattern 3010: 3009: 3005: 3004: 3003: 3001: 3000: 2999: 2985: 2984: 2983: 2978: 2957: 2936: 2927:Douglas Schmidt 2907:Ward Cunningham 2865: 2853:Design Patterns 2840: 2831:Method chaining 2763: 2757: 2718:Service locator 2649: 2642: 2613:Read–write lock 2549: 2538: 2529:Template method 2470: 2422: 2380: 2373: 2368: 2324: 2321: 2316: 2307: 2305: 2296: 2295: 2291: 2278: 2277: 2273: 2266: 2251:Design Patterns 2246:Vlissides, John 2236: 2235: 2231: 2222: 2220: 2211: 2210: 2206: 2189: 2185: 2164: 2163: 2159: 2155: 2138:Design Patterns 2128: 2123: 2122: 2119: 2116: 2113: 2110: 2107: 2105:"bob" 2104: 2101: 2098: 2095: 2092: 2089: 2086: 2083: 2080: 2077: 2074: 2071: 2068: 2066:"bob" 2065: 2062: 2059: 2056: 2053: 2050: 2047: 2044: 2041: 2038: 2035: 2032: 2029: 2026: 2023: 2020: 2017: 2015:"bob" 2014: 2011: 2008: 2005: 2002: 1999: 1996: 1993: 1990: 1987: 1984: 1981: 1978: 1975: 1972: 1969: 1966: 1963: 1960: 1957: 1954: 1951: 1948: 1945: 1942: 1939: 1936: 1933: 1930: 1927: 1924: 1921: 1918: 1915: 1912: 1909: 1907:"bob" 1906: 1903: 1900: 1897: 1894: 1891: 1888: 1885: 1882: 1879: 1876: 1873: 1870: 1867: 1864: 1861: 1858: 1855: 1852: 1849: 1846: 1843: 1840: 1837: 1834: 1831: 1828: 1825: 1822: 1819: 1816: 1813: 1810: 1807: 1804: 1801: 1798: 1795: 1792: 1789: 1786: 1783: 1780: 1777: 1774: 1771: 1768: 1766:notifyObservers 1765: 1762: 1759: 1756: 1753: 1750: 1747: 1744: 1741: 1738: 1735: 1732: 1729: 1726: 1723: 1720: 1717: 1714: 1711: 1708: 1705: 1702: 1699: 1696: 1693: 1690: 1687: 1684: 1681: 1678: 1675: 1672: 1669: 1666: 1663: 1660: 1657: 1654: 1651: 1648: 1645: 1642: 1639: 1636: 1633: 1630: 1627: 1624: 1621: 1618: 1615: 1612: 1609: 1606: 1603: 1600: 1597: 1594: 1591: 1588: 1585: 1582: 1579: 1576: 1573: 1570: 1567: 1564: 1561: 1558: 1555: 1552: 1549: 1546: 1543: 1540: 1537: 1534: 1531: 1528: 1525: 1522: 1519: 1516: 1513: 1511:computeIfAbsent 1510: 1507: 1504: 1501: 1498: 1495: 1492: 1489: 1486: 1483: 1480: 1477: 1474: 1471: 1468: 1465: 1462: 1459: 1456: 1453: 1450: 1447: 1444: 1441: 1438: 1435: 1432: 1429: 1426: 1423: 1420: 1417: 1414: 1411: 1408: 1405: 1402: 1399: 1396: 1393: 1390: 1387: 1384: 1381: 1378: 1375: 1372: 1369: 1366: 1363: 1360: 1357: 1354: 1351: 1348: 1345: 1342: 1339: 1337:notifyObservers 1336: 1333: 1330: 1327: 1324: 1321: 1318: 1315: 1312: 1309: 1306: 1303: 1300: 1297: 1294: 1291: 1288: 1285: 1282: 1279: 1276: 1273: 1270: 1267: 1264: 1261: 1258: 1255: 1252: 1249: 1246: 1243: 1240: 1237: 1234: 1231: 1228: 1225: 1222: 1219: 1216: 1213: 1210: 1207: 1204: 1201: 1198: 1195: 1192: 1189: 1186: 1183: 1180: 1177: 1167:notifyObservers 1166: 1161: 1157: 1154: 1149: 1148: 1145: 1142: 1139: 1136: 1133: 1130: 1127: 1124: 1121: 1118: 1115: 1112: 1109: 1106: 1103: 1100: 1097: 1094: 1091: 1088: 1085: 1082: 1079: 1076: 1073: 1070: 1067: 1064: 1061: 1058: 1055: 1052: 1049: 1046: 1043: 1040: 1037: 1034: 1031: 1028: 1025: 1022: 1019: 1016: 1013: 1010: 1007: 1004: 1001: 998: 995: 992: 989: 986: 983: 981:MessageReceived 980: 977: 974: 971: 968: 965: 962: 959: 956: 953: 950: 947: 944: 941: 938: 935: 932: 929: 926: 923: 920: 917: 914: 911: 908: 905: 902: 899: 896: 893: 890: 887: 884: 881: 878: 875: 872: 869: 866: 863: 860: 857: 854: 851: 848: 845: 843:MessageReceived 842: 839: 836: 833: 830: 827: 824: 821: 818: 815: 812: 809: 806: 803: 800: 798:MessageReceived 797: 794: 791: 788: 785: 782: 779: 776: 773: 770: 767: 764: 761: 758: 755: 753:MessageReceived 752: 749: 746: 743: 740: 737: 734: 731: 728: 725: 722: 719: 716: 713: 710: 707: 704: 701: 698: 683:when used with 680: 679: 676: 673: 670: 667: 664: 661: 658: 655: 652: 649: 646: 643: 640: 637: 634: 631: 628: 625: 622: 619: 616: 613: 610: 607: 604: 601: 598: 595: 592: 589: 586: 583: 580: 577: 574: 571: 568: 565: 562: 559: 556: 553: 550: 547: 544: 541: 538: 535: 532: 529: 526: 523: 520: 517: 514: 511: 508: 505: 502: 499: 496: 493: 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 457: 454: 451: 448: 445: 442: 439: 436: 433: 430: 427: 424: 421: 418: 415: 412: 409: 406: 403: 400: 397: 394: 391: 385:loosely coupled 381: 376: 308: 299: 295: 291: 287: 283: 279: 272: 268: 264: 260: 256: 252: 248: 244: 237: 233: 229: 215: 211: 207: 203: 199: 195: 191: 173: 168: 159: 148:loosely coupled 133: 110: 106: 102: 100: 99: 91:design patterns 87: 75:mediator object 24: 21: 12: 11: 5: 3008: 3006: 2998: 2997: 2987: 2986: 2980: 2979: 2977: 2976: 2971: 2965: 2963: 2959: 2958: 2956: 2955: 2950: 2944: 2942: 2938: 2937: 2935: 2934: 2929: 2924: 2919: 2914: 2909: 2904: 2899: 2894: 2892:John Vlissides 2889: 2884: 2879: 2873: 2871: 2867: 2866: 2864: 2863: 2856: 2848: 2846: 2842: 2841: 2839: 2838: 2833: 2828: 2823: 2818: 2813: 2808: 2803: 2798: 2793: 2788: 2783: 2778: 2773: 2767: 2765: 2759: 2758: 2756: 2755: 2750: 2745: 2740: 2735: 2730: 2725: 2720: 2715: 2710: 2705: 2700: 2692: 2687: 2682: 2681: 2680: 2675: 2665: 2660: 2654: 2652: 2644: 2643: 2641: 2640: 2635: 2630: 2625: 2620: 2615: 2610: 2605: 2600: 2595: 2590: 2585: 2580: 2575: 2570: 2565: 2560: 2554: 2552: 2544: 2543: 2540: 2539: 2537: 2536: 2531: 2526: 2521: 2516: 2511: 2506: 2501: 2496: 2491: 2486: 2480: 2478: 2472: 2471: 2469: 2468: 2463: 2458: 2453: 2448: 2443: 2438: 2432: 2430: 2424: 2423: 2421: 2420: 2415: 2410: 2408:Factory method 2405: 2400: 2394: 2392: 2383: 2375: 2374: 2369: 2367: 2366: 2359: 2352: 2344: 2338: 2337: 2332:Stack Overflow 2320: 2319:External links 2317: 2315: 2314: 2289: 2271: 2264: 2256:Addison-Wesley 2242:Johnson, Ralph 2229: 2204: 2183: 2156: 2154: 2151: 2150: 2149: 2143: 2134: 2132:Data mediation 2127: 2124: 1176: 1153: 1150: 697: 390: 380: 377: 375: 372: 321: 320: 307: 304: 243:Assuming that 172: 169: 167: 164: 158: 155: 141: 140: 137: 132: 129: 118: 117: 114: 98: 95: 86: 83: 51:Business logic 22: 18:Broker pattern 13: 10: 9: 6: 4: 3: 2: 3007: 2996: 2993: 2992: 2990: 2975: 2972: 2970: 2967: 2966: 2964: 2960: 2954: 2951: 2949: 2946: 2945: 2943: 2939: 2933: 2930: 2928: 2925: 2923: 2920: 2918: 2917:Robert Martin 2915: 2913: 2912:Martin Fowler 2910: 2908: 2905: 2903: 2900: 2898: 2895: 2893: 2890: 2888: 2887:Ralph Johnson 2885: 2883: 2880: 2878: 2875: 2874: 2872: 2868: 2862: 2861: 2857: 2855: 2854: 2850: 2849: 2847: 2843: 2837: 2834: 2832: 2829: 2827: 2824: 2822: 2819: 2817: 2814: 2812: 2809: 2807: 2804: 2802: 2799: 2797: 2794: 2792: 2789: 2787: 2784: 2782: 2779: 2777: 2774: 2772: 2769: 2768: 2766: 2760: 2754: 2751: 2749: 2746: 2744: 2741: 2739: 2736: 2734: 2731: 2729: 2726: 2724: 2723:Active record 2721: 2719: 2716: 2714: 2713:Naked objects 2711: 2709: 2706: 2704: 2703:Specification 2701: 2699: 2697: 2693: 2691: 2688: 2686: 2683: 2679: 2676: 2674: 2671: 2670: 2669: 2666: 2664: 2661: 2659: 2656: 2655: 2653: 2651: 2648:Architectural 2645: 2639: 2636: 2634: 2631: 2629: 2626: 2624: 2621: 2619: 2616: 2614: 2611: 2609: 2606: 2604: 2601: 2599: 2596: 2594: 2591: 2589: 2586: 2584: 2581: 2579: 2576: 2574: 2571: 2569: 2566: 2564: 2561: 2559: 2558:Active object 2556: 2555: 2553: 2551: 2545: 2535: 2532: 2530: 2527: 2525: 2522: 2520: 2517: 2515: 2512: 2510: 2507: 2505: 2502: 2500: 2497: 2495: 2492: 2490: 2487: 2485: 2482: 2481: 2479: 2477: 2473: 2467: 2464: 2462: 2459: 2457: 2454: 2452: 2449: 2447: 2444: 2442: 2439: 2437: 2434: 2433: 2431: 2429: 2425: 2419: 2416: 2414: 2411: 2409: 2406: 2404: 2401: 2399: 2396: 2395: 2393: 2391: 2387: 2384: 2382: 2376: 2372: 2365: 2360: 2358: 2353: 2351: 2346: 2345: 2342: 2334: 2333: 2328: 2323: 2322: 2318: 2304: 2300: 2293: 2290: 2285: 2281: 2275: 2272: 2267: 2265:0-201-63361-2 2261: 2257: 2253: 2252: 2247: 2243: 2239: 2233: 2230: 2219: 2215: 2208: 2205: 2200: 2194: 2186: 2184:0-201-63361-2 2180: 2176: 2171: 2170: 2161: 2158: 2152: 2147: 2144: 2141: 2139: 2135: 2133: 2130: 2129: 2125: 1174: 1172: 1151: 695: 693: 690: 686: 388: 386: 378: 373: 371: 370: 366: 362: 358: 357: 353: 349: 345: 343: 339: 335: 331: 329: 325: 318: 317: 312: 306:Class diagram 305: 303: 284:mediate(this) 276: 257:mediate(this) 241: 227: 224: 219: 189: 188:class diagram 186: 183:In the above 177: 170: 165: 163: 156: 154: 151: 149: 144: 138: 135: 134: 130: 128: 126: 122: 115: 112: 111: 105: 96: 94: 92: 84: 82: 80: 76: 71: 68: 67:communication 64: 60: 56: 52: 48: 43: 41: 37: 33: 29: 19: 2969:Anti-pattern 2932:Linda Rising 2858: 2851: 2796:Lazy loading 2728:Identity map 2695: 2503: 2379:Gang of Four 2330: 2306:. Retrieved 2302: 2292: 2284:SourceMaking 2283: 2274: 2249: 2238:Gamma, Erich 2232: 2221:. Retrieved 2217: 2207: 2168: 2160: 2136: 1832:MediatorDemo 1155: 681: 382: 368: 367:through its 364: 360: 359: 355: 354:through its 351: 347: 346: 341: 337: 333: 332: 327: 323: 322: 319:Participants 278:Thereafter, 277: 242: 220: 182: 160: 152: 147: 145: 142: 124: 123: 119: 88: 74: 72: 44: 36:encapsulates 31: 25: 2941:Communities 2922:Jim Coplien 2897:Grady Booch 2882:Erich Gamma 2826:Type tunnel 2811:Object pool 2806:Null object 2801:Mock object 2663:Interceptor 2633:Thread pool 2548:Concurrency 2494:Interpreter 2072:orElseThrow 2009:addObserver 1733:storageName 1676:storageName 1667:addObserver 1634:storageName 1598:storageName 1559:storageName 1517:storageName 1478:storageName 1343:storageName 1295:storageName 608:ChangeState 63:refactoring 59:maintenance 55:computation 2836:Delegation 2771:Blackboard 2476:Behavioral 2428:Structural 2390:Creational 2308:2017-08-12 2223:2017-08-12 2153:References 1622:storageMap 1616:ofNullable 1505:storageMap 1403:storageMap 656:Component2 632:Component1 581:Component2 578:IComponent 554:Component1 551:IComponent 488:IComponent 482:Component2 431:IComponent 425:Component1 395:IComponent 365:Colleagues 352:Colleagues 342:Colleagues 300:Colleague1 292:Colleague2 280:Colleague2 273:Colleague2 265:Colleague1 253:Colleague1 249:Colleague2 245:Colleague1 238:Colleague2 234:Colleague1 216:Colleague2 212:Colleague1 196:Colleague2 192:Colleague1 157:Definition 2902:Kent Beck 2628:Semaphore 2618:Scheduler 2461:Flyweight 2451:Decorator 2446:Composite 2418:Singleton 2413:Prototype 2303:w3sDesign 2218:w3sDesign 2193:cite book 1961:ifPresent 1814:eventName 1784:observers 1775:eventName 1721:eventName 1706:eventName 1694:observers 1445:observers 1119:_mediator 1062:WriteLine 975:_mediator 963:_mediator 888:_mediator 819:WriteLine 692:callbacks 392:interface 348:Colleague 338:Colleague 328:Colleague 296:action1() 288:Mediator1 269:action2() 261:Mediator1 240:objects. 230:Mediator1 208:Mediator1 204:mediate() 166:Structure 2989:Category 2962:See also 2764:patterns 2650:patterns 2603:Proactor 2550:patterns 2524:Strategy 2514:Observer 2504:Mediator 2499:Iterator 2381:patterns 2248:(1994). 2126:See also 2099:setValue 2093:mediator 2060:getValue 2054:mediator 2003:mediator 1949:getValue 1943:mediator 1925:setValue 1919:mediator 1901:setValue 1895:mediator 1889:<> 1886:Mediator 1877:mediator 1865:Mediator 1802:observer 1796:observer 1742:observer 1685:observer 1682:Runnable 1652:getValue 1610:Optional 1589:getValue 1577:Optional 1547:setValue 1535:<> 1469:setValue 1457:<> 1442:>> 1433:Consumer 1415:<> 1400:>> 1358:Mediator 1331:mediator 1286:mediator 1274:Mediator 1268:setValue 1244:getValue 1158:Mediator 969:mediator 933:mediator 930:Mediator 885:Mediator 738:Mediator 702:delegate 689:delegate 685:remoting 662:SetState 638:SetState 602:internal 575:internal 548:internal 542:Mediator 500:SetState 494:internal 443:SetState 437:internal 404:SetState 369:Mediator 356:Mediator 330:objects 324:Mediator 200:Mediator 85:Overview 79:coupling 2816:Servant 2748:Model 2 2608:Reactor 2598:Monitor 2563:Balking 2534:Visitor 2509:Memento 2489:Command 2436:Adapter 2403:Builder 2042:println 1985:println 1871:Integer 1790:forEach 1646:Storage 1541:storage 1532:Storage 1499:storage 1496:Storage 1421:private 1412:HashMap 1391:Storage 1379:HashMap 1373:private 1217:Storage 1162:Storage 1131:message 1110:message 1080:message 1056:Console 1020:message 1011:Receive 1005:private 996:Receive 882:private 849:message 831:message 813:Console 774:message 717:message 374:Example 286:on the 259:on the 61:and/or 47:classes 2870:People 2753:Broker 2456:Facade 2441:Bridge 2262:  2181:  2030:System 1973:System 1853:String 1841:static 1838:public 1826:public 1808:accept 1772:String 1727:equals 1673:String 1661:public 1607:return 1595:String 1574:public 1475:String 1463:public 1439:String 1385:String 1292:String 1253:return 1205:import 1196:import 1187:import 1178:import 1107:string 1095:public 1086:sender 1044:sender 1029:sender 1026:string 1017:string 939:string 924:Person 921:public 897:string 894:public 876:Person 870:public 855:sender 837:sender 783:sender 780:string 771:string 759:public 744:public 732:public 726:sender 723:string 714:string 699:public 614:object 506:object 449:object 410:object 282:calls 255:calls 190:, the 101:": --> 30:, the 2845:Books 2762:Other 2698:-tier 2519:State 2466:Proxy 2175:273ff 2024:-> 1970:-> 1829:class 1799:-> 1709:-> 1565:value 1526:-> 1487:value 1424:final 1376:final 1355:class 1325:value 1319:value 1304:value 1256:value 1235:value 1214:class 873:class 747:event 735:class 668:state 644:state 617:state 539:class 518:throw 509:state 479:class 461:throw 452:state 422:class 413:state 2821:Twin 2678:MVVM 2593:Lock 2588:Join 2260:ISBN 2199:link 2179:ISBN 1874:> 1868:< 1856:args 1847:main 1844:void 1763:void 1664:void 1586:> 1580:< 1553:this 1538:()); 1523:name 1466:void 1436:< 1430:< 1394:< 1382:< 1367:> 1361:< 1313:this 1283:> 1277:< 1265:void 1226:> 1220:< 1152:Java 1137:Name 1125:Send 1101:Send 1098:void 1074:Name 1050:Name 1008:void 957:name 951:Name 942:name 900:Name 804:null 765:Send 762:void 705:void 650:this 626:this 605:void 497:void 440:void 401:void 236:and 221:The 214:and 194:and 103:edit 53:and 2690:ECS 2685:ADR 2673:MVP 2668:MVC 2090:}); 2087:)); 2084:new 2036:out 2000:)); 1997:age 1979:out 1967:age 1892:(); 1883:new 1817:)); 1757:}); 1751:(); 1748:run 1700:add 1640:map 1637:)). 1628:get 1529:new 1460:(); 1451:new 1418:(); 1409:new 1173:). 987:new 912:set 906:get 593:set 587:get 566:set 560:get 527:(); 521:new 470:(); 464:new 298:on 271:on 223:UML 185:UML 26:In 2991:: 2329:. 2301:. 2282:. 2258:. 2254:. 2244:; 2216:. 2195:}} 2191:{{ 2177:. 2114:); 2111:21 2081::: 2069:). 2021:() 1958:). 1940:); 1937:24 1916:); 1913:20 1736:)) 1715:if 1655:); 1649::: 1568:); 1346:); 1247:() 1140:); 1089:); 1047:!= 1038:if 999:); 984:+= 858:); 840:); 801:!= 792:if 729:); 671:); 647:); 416:); 379:C# 302:. 275:. 218:. 81:. 49:. 2696:n 2363:e 2356:t 2349:v 2335:. 2311:. 2286:. 2268:. 2226:. 2201:) 2187:. 2140:, 2120:} 2117:} 2108:, 2102:( 2096:. 2075:( 2063:( 2057:. 2051:+ 2045:( 2039:. 2033:. 2027:{ 2018:, 2012:( 2006:. 1994:+ 1988:( 1982:. 1976:. 1964:( 1952:( 1946:. 1934:, 1928:( 1922:. 1910:, 1904:( 1898:. 1880:= 1862:{ 1859:) 1850:( 1835:{ 1823:} 1820:} 1811:( 1805:. 1793:( 1787:. 1781:{ 1778:) 1769:( 1760:} 1754:} 1745:. 1739:{ 1730:( 1724:. 1718:( 1712:{ 1703:( 1697:. 1691:{ 1688:) 1679:, 1670:( 1658:} 1643:( 1631:( 1625:. 1619:( 1613:. 1604:{ 1601:) 1592:( 1583:T 1571:} 1562:, 1556:, 1550:( 1544:. 1520:, 1514:( 1508:. 1502:= 1493:{ 1490:) 1484:T 1481:, 1472:( 1448:= 1406:= 1397:T 1388:, 1370:{ 1364:T 1352:} 1349:} 1340:( 1334:. 1328:; 1322:= 1316:. 1310:{ 1307:) 1301:T 1298:, 1289:, 1280:T 1271:( 1262:} 1259:; 1250:{ 1241:T 1238:; 1232:T 1229:{ 1223:T 1211:; 1202:; 1193:; 1184:; 1146:} 1143:} 1134:, 1128:( 1122:. 1116:{ 1113:) 1104:( 1092:} 1083:, 1077:, 1071:, 1065:( 1059:. 1053:) 1041:( 1035:{ 1032:) 1023:, 1014:( 1002:} 993:( 978:. 972:; 966:= 960:; 954:= 948:{ 945:) 936:, 927:( 918:} 915:; 909:; 903:{ 891:; 879:{ 867:} 864:} 861:} 852:, 846:( 834:, 828:, 822:( 816:. 810:{ 807:) 795:( 789:{ 786:) 777:, 768:( 756:; 741:{ 720:, 711:( 677:} 674:} 665:( 659:. 653:. 641:( 635:. 629:. 623:{ 620:) 611:( 599:} 596:; 590:; 584:{ 572:} 569:; 563:; 557:{ 545:{ 533:} 530:} 515:{ 512:) 503:( 491:{ 485:: 476:} 473:} 458:{ 455:) 446:( 434:{ 428:: 419:} 407:( 398:{ 107:] 20:.

Index

Broker pattern
software engineering
encapsulates
behavioral pattern
classes
Business logic
computation
maintenance
refactoring
communication
coupling
design patterns

UML
class diagram
UML
sequence diagram

loosely coupled
remoting
delegate
callbacks
observer pattern
Data mediation
Design Patterns
Software design pattern
Design Patterns: Elements of Reusable Object-Oriented Software
273ff
ISBN
0-201-63361-2

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

↑