Knowledge

Model–view–presenter

Source 📝

289:
presenter that has no parameters and no return value. The presenter then retrieves data from the view through methods defined by the view interface. Finally, the presenter operates on the model and updates the view with the results of the operation. Other versions of model–view–presenter allow some latitude with respect to which class handles a particular interaction, event, or command. This is often more suitable for web-based architectures, where the view, which executes on a client's browser, may be the best place to handle a particular interaction or command.
20: 288:
The degree of logic permitted in the view varies among different implementations. At one extreme, the view is entirely passive, forwarding all interaction operations to the presenter. In this formulation, when a user triggers an event method of the view, it does nothing but invoke a method of the
355:
The same approach can be used for Java web-based applications, since modern Java component-based Web frameworks allow development of client-side logic using the same component approach as thick clients.
423:'s flexible runtime environment, there are wide possibilities of approaches of an application logic. Implementation of model layer is left on the end application programmer. 317:
environment supports the MVP pattern much like any other development environment. The same model and presenter class can be used to support multiple interfaces, such as an
99:
The evolution and multiple variants of the MVP pattern, including the relationship of MVP to other design patterns such as MVC, is discussed in detail in an article by
328:
In addition to manually implementing the pattern, a model–view–presenter framework may be used to support the MVP pattern in a more automated fashion.
1270: 325:
application. The presenter gets and sets information from/to the view through an interface that can be accessed by the interface (view) component.
632: 605: 112: 152:
acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view.
465: 1157: 1265: 1182: 484: 100: 580: 522:"Twisting the Triad. The evolution of the Dolphin Smalltalk MVP application framework." Andy Bower, Blair McGlashan 292:
From a layering point of view, the presenter class might be considered as belonging to the application layer in a
1130: 955: 754: 848: 161: 978: 938: 625: 455: 35: 948: 460: 352:) application, the MVP pattern can be used by letting the user interface class implement a view interface. 49:
assumes the functionality of the "middle-man". In MVP, all presentation logic is pushed to the presenter.
1223: 1061: 337: 157: 78: 838: 296:
system, but it can also be seen as a presenter layer of its own between the application layer and the
1046: 1041: 868: 293: 363:
requires only that some component implement the view interface. The same approach is possible using
1086: 1051: 1018: 668: 618: 521: 92:
began incorporating MVP into its documentation and examples for user interface programming in the
988: 960: 898: 883: 863: 799: 641: 349: 341: 88:
adapted the MVP pattern to form the basis for their Smalltalk user interface framework. In 2006,
501:
Needs research - This model was in use in the ERP space (Lawson Software Inc.) long before this.
134:
is an interface defining the data to be displayed or otherwise acted upon in the user interface.
965: 893: 843: 678: 450: 123: 1244: 1147: 993: 973: 918: 39: 1056: 1013: 1008: 998: 908: 600: 19: 8: 1096: 1081: 1076: 933: 818: 764: 533: 551: 511:"MVP: Model-View-Presenter. The Taligent Programming Model for C++ and Java." Mike Potel 1218: 1197: 1106: 1003: 853: 746: 698: 660: 388: 360: 888: 731: 721: 716: 688: 683: 142: 85: 73:. MVP is the underlying programming model for application development in Taligent's 1187: 928: 873: 794: 784: 774: 769: 510: 383: 368: 568: 1177: 1123: 1101: 878: 833: 804: 779: 759: 706: 673: 649: 116: 70: 141:
is a passive interface that displays data (the model) and routes user commands (
1162: 1023: 726: 711: 408: 314: 297: 93: 160:
the concrete presenter object, providing a reference to itself. The following
77:-based CommonPoint environment. The pattern was later migrated by Taligent to 1259: 983: 828: 789: 736: 322: 84:
After Taligent's discontinuation in 1998, Andy Bower and Blair McGlashan of
1239: 1202: 1091: 1066: 858: 610: 398: 345: 119: 57:
The model–view–presenter software pattern originated in the early 1990s at
1192: 1167: 1152: 1071: 903: 430: 62: 23:
Diagram that depicts the model–view–presenter (MVP) GUI design pattern
1172: 89: 58: 435: 318: 403: 378: 364: 606:
Model-View-Presenter implementation thoughts at StackExchange
393: 74: 420: 66: 81:
and popularized in a paper by Taligent CTO Mike Potel.
42:, and is used mostly for building user interfaces. 601:Model View Presenter Example from the GWT project. 1257: 581:"Interactive Application Architecture Patterns" 626: 164:code demonstrates a simple view constructor: 640: 633: 619: 145:) to the presenter to act upon that data. 1271:Architectural pattern (computer science) 552:"The Model-View-Presenter (MVP) Pattern" 18: 374:Java frameworks include the following: 1258: 426:PHP frameworks include the following: 614: 466:Presenter first (software approach) 13: 303: 156:Normally, the view implementation 14: 1282: 594: 569:"GUI Architectures" Martin Fowler 1131:Enterprise Integration Patterns 573: 562: 544: 526: 515: 504: 495: 477: 1: 471: 103:and another by Derek Greer. 7: 1224:Portland Pattern Repository 444: 106: 10: 1287: 52: 1232: 1211: 1140: 1115: 1032: 917: 817: 745: 697: 659: 648: 585:www.aspiringcraftsman.com 294:multilayered architecture 115:engineered to facilitate 34:) is a derivation of the 1266:Software design patterns 849:Event-based asynchronous 642:Software design patterns 166: 111:MVP is a user interface 755:Chain of responsibility 331: 308: 126:in presentation logic: 16:Software design pattern 894:Scheduled-task pattern 844:Double-checked locking 534:"MSDN Magazine Issues" 451:Multitier architecture 414: 124:separation of concerns 24: 1245:Architectural pattern 1148:Christopher Alexander 489:developers.google.com 456:Model–view–controller 321:Web application or a 113:architectural pattern 61:, a joint venture of 40:architectural pattern 36:model–view–controller 22: 1057:Dependency injection 1014:Inversion of control 1009:Data transfer object 909:Thread-local storage 461:Model–view–viewmodel 359:Implementing MVP in 28:Model–view–presenter 1062:Intercepting filter 1219:The Hillside Group 1004:Data access object 854:Guarded suspension 839:Binding properties 556:msdn.microsoft.com 538:msdn.microsoft.com 389:Google Web Toolkit 361:Google Web Toolkit 25: 1253: 1252: 1047:Business delegate 979:Publish–subscribe 813: 812: 540:. 7 October 2019. 86:Dolphin Smalltalk 1278: 1052:Composite entity 929:Front controller 669:Abstract factory 657: 656: 635: 628: 621: 612: 611: 589: 588: 577: 571: 566: 560: 559: 558:. 27 April 2010. 548: 542: 541: 530: 524: 519: 513: 508: 502: 499: 493: 492: 481: 284: 281: 278: 275: 272: 269: 266: 263: 260: 257: 254: 251: 248: 245: 242: 239: 236: 233: 230: 227: 224: 221: 218: 215: 212: 209: 206: 203: 200: 197: 194: 191: 188: 185: 182: 179: 176: 173: 170: 122:and improve the 1286: 1285: 1281: 1280: 1279: 1277: 1276: 1275: 1256: 1255: 1254: 1249: 1228: 1207: 1198:Douglas Schmidt 1178:Ward Cunningham 1136: 1124:Design Patterns 1111: 1102:Method chaining 1034: 1028: 989:Service locator 920: 913: 884:Read–write lock 820: 809: 800:Template method 741: 693: 651: 644: 639: 597: 592: 579: 578: 574: 567: 563: 550: 549: 545: 532: 531: 527: 520: 516: 509: 505: 500: 496: 483: 482: 478: 474: 447: 440:Nette Framework 417: 371:Web framework. 334: 311: 306: 304:Implementations 286: 285: 282: 279: 276: 273: 270: 267: 264: 261: 258: 255: 252: 249: 246: 243: 240: 237: 234: 231: 228: 225: 222: 219: 216: 213: 210: 207: 204: 201: 198: 195: 192: 189: 186: 183: 180: 177: 174: 171: 168: 109: 71:Hewlett-Packard 55: 17: 12: 11: 5: 1284: 1274: 1273: 1268: 1251: 1250: 1248: 1247: 1242: 1236: 1234: 1230: 1229: 1227: 1226: 1221: 1215: 1213: 1209: 1208: 1206: 1205: 1200: 1195: 1190: 1185: 1180: 1175: 1170: 1165: 1163:John Vlissides 1160: 1155: 1150: 1144: 1142: 1138: 1137: 1135: 1134: 1127: 1119: 1117: 1113: 1112: 1110: 1109: 1104: 1099: 1094: 1089: 1084: 1079: 1074: 1069: 1064: 1059: 1054: 1049: 1044: 1038: 1036: 1030: 1029: 1027: 1026: 1021: 1016: 1011: 1006: 1001: 996: 991: 986: 981: 976: 971: 963: 958: 953: 952: 951: 946: 936: 931: 925: 923: 915: 914: 912: 911: 906: 901: 896: 891: 886: 881: 876: 871: 866: 861: 856: 851: 846: 841: 836: 831: 825: 823: 815: 814: 811: 810: 808: 807: 802: 797: 792: 787: 782: 777: 772: 767: 762: 757: 751: 749: 743: 742: 740: 739: 734: 729: 724: 719: 714: 709: 703: 701: 695: 694: 692: 691: 686: 681: 679:Factory method 676: 671: 665: 663: 654: 646: 645: 638: 637: 630: 623: 615: 609: 608: 603: 596: 595:External links 593: 591: 590: 572: 561: 543: 525: 514: 503: 494: 475: 473: 470: 469: 468: 463: 458: 453: 446: 443: 442: 441: 438: 433: 416: 413: 412: 411: 406: 401: 396: 391: 386: 381: 333: 330: 310: 307: 305: 302: 298:user interface 167: 154: 153: 146: 135: 108: 105: 94:.NET Framework 54: 51: 15: 9: 6: 4: 3: 2: 1283: 1272: 1269: 1267: 1264: 1263: 1261: 1246: 1243: 1241: 1238: 1237: 1235: 1231: 1225: 1222: 1220: 1217: 1216: 1214: 1210: 1204: 1201: 1199: 1196: 1194: 1191: 1189: 1188:Robert Martin 1186: 1184: 1183:Martin Fowler 1181: 1179: 1176: 1174: 1171: 1169: 1166: 1164: 1161: 1159: 1158:Ralph Johnson 1156: 1154: 1151: 1149: 1146: 1145: 1143: 1139: 1133: 1132: 1128: 1126: 1125: 1121: 1120: 1118: 1114: 1108: 1105: 1103: 1100: 1098: 1095: 1093: 1090: 1088: 1085: 1083: 1080: 1078: 1075: 1073: 1070: 1068: 1065: 1063: 1060: 1058: 1055: 1053: 1050: 1048: 1045: 1043: 1040: 1039: 1037: 1031: 1025: 1022: 1020: 1017: 1015: 1012: 1010: 1007: 1005: 1002: 1000: 997: 995: 994:Active record 992: 990: 987: 985: 984:Naked objects 982: 980: 977: 975: 974:Specification 972: 970: 968: 964: 962: 959: 957: 954: 950: 947: 945: 942: 941: 940: 937: 935: 932: 930: 927: 926: 924: 922: 919:Architectural 916: 910: 907: 905: 902: 900: 897: 895: 892: 890: 887: 885: 882: 880: 877: 875: 872: 870: 867: 865: 862: 860: 857: 855: 852: 850: 847: 845: 842: 840: 837: 835: 832: 830: 829:Active object 827: 826: 824: 822: 816: 806: 803: 801: 798: 796: 793: 791: 788: 786: 783: 781: 778: 776: 773: 771: 768: 766: 763: 761: 758: 756: 753: 752: 750: 748: 744: 738: 735: 733: 730: 728: 725: 723: 720: 718: 715: 713: 710: 708: 705: 704: 702: 700: 696: 690: 687: 685: 682: 680: 677: 675: 672: 670: 667: 666: 664: 662: 658: 655: 653: 647: 643: 636: 631: 629: 624: 622: 617: 616: 613: 607: 604: 602: 599: 598: 586: 582: 576: 570: 565: 557: 553: 547: 539: 535: 529: 523: 518: 512: 507: 498: 490: 486: 485:"GWT Project" 480: 476: 467: 464: 462: 459: 457: 454: 452: 449: 448: 439: 437: 434: 432: 429: 428: 427: 424: 422: 410: 407: 405: 402: 400: 397: 395: 392: 390: 387: 385: 382: 380: 377: 376: 375: 372: 370: 366: 362: 357: 353: 351: 347: 343: 339: 329: 326: 324: 323:Windows Forms 320: 316: 301: 299: 295: 290: 165: 163: 159: 151: 147: 144: 140: 136: 133: 129: 128: 127: 125: 121: 118: 114: 104: 102: 101:Martin Fowler 97: 95: 91: 87: 82: 80: 76: 72: 68: 64: 60: 50: 48: 43: 41: 37: 33: 29: 21: 1240:Anti-pattern 1203:Linda Rising 1129: 1122: 1067:Lazy loading 999:Identity map 966: 943: 650:Gang of Four 584: 575: 564: 555: 546: 537: 528: 517: 506: 497: 488: 479: 425: 418: 373: 358: 354: 335: 327: 312: 291: 287: 158:instantiates 155: 149: 138: 131: 120:unit testing 110: 98: 83: 56: 46: 45:In MVP, the 44: 31: 27: 26: 1212:Communities 1193:Jim Coplien 1168:Grady Booch 1153:Erich Gamma 1097:Type tunnel 1082:Object pool 1077:Null object 1072:Mock object 934:Interceptor 904:Thread pool 819:Concurrency 765:Interpreter 431:CodeIgniter 1260:Categories 1107:Delegation 1042:Blackboard 747:Behavioral 699:Structural 661:Creational 472:References 259:_presenter 241:_presenter 238:IPresenter 181:IPresenter 1173:Kent Beck 899:Semaphore 889:Scheduler 732:Flyweight 722:Decorator 717:Composite 689:Singleton 684:Prototype 268:Presenter 190:Presenter 175:Presenter 150:presenter 117:automated 90:Microsoft 47:presenter 1233:See also 1035:patterns 921:patterns 874:Proactor 821:patterns 795:Strategy 785:Observer 775:Mediator 770:Iterator 652:patterns 445:See also 107:Overview 59:Taligent 1087:Servant 1019:Model 2 879:Reactor 869:Monitor 834:Balking 805:Visitor 780:Memento 760:Command 707:Adapter 674:Builder 436:Laravel 367:or the 319:ASP.NET 300:layer. 235:private 53:History 1141:People 1024:Broker 727:Facade 712:Bridge 419:As of 404:Vaadin 379:JavaFX 365:Vaadin 247:public 217:public 208:// ... 187:public 169:public 143:events 69:, and 38:(MVC) 1116:Books 1033:Other 969:-tier 790:State 737:Proxy 399:Swing 394:JFace 384:Echo2 369:Echo2 346:Swing 336:In a 229:IView 220:class 196:IView 172:class 132:model 63:Apple 1092:Twin 949:MVVM 864:Lock 859:Join 338:Java 332:Java 315:.NET 313:The 309:.NET 274:this 250:View 223:View 199:view 148:The 139:view 137:The 130:The 79:Java 961:ECS 956:ADR 944:MVP 939:MVC 421:PHP 415:PHP 350:SWT 342:AWT 265:new 75:C++ 67:IBM 32:MVP 1262:: 583:. 554:. 536:. 487:. 409:ZK 277:); 253:() 162:C# 96:. 65:, 967:n 634:e 627:t 620:v 587:. 491:. 348:/ 344:/ 340:( 283:} 280:} 271:( 262:= 256:{ 244:; 232:{ 226:: 214:} 211:} 205:{ 202:) 193:( 184:{ 178:: 30:(

Index


model–view–controller
architectural pattern
Taligent
Apple
IBM
Hewlett-Packard
C++
Java
Dolphin Smalltalk
Microsoft
.NET Framework
Martin Fowler
architectural pattern
automated
unit testing
separation of concerns
events
instantiates
C#
multilayered architecture
user interface
.NET
ASP.NET
Windows Forms
Java
AWT
Swing
SWT
Google Web Toolkit

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