Is PAC, just MVP with passive view?
In few words: is the PAC (Presentation‑Abstraction‑Control) design pattern, just the MVP (Model‑View‑Presenter) pattern where the view is a passive view?
As far as I can understand
MVP is a Presenter, talking with a Model. Then a View talking to the Presenter, and the other way too, the Presenter can talk to the View, that is:
View <--> Presenter --> Model
with incoming user events coming from the View [*].
PAC is a Controller, which talks to both the Presentation and the Abstraction, but the Presentation does not talk to the Controller (but still sends events the Controller may intercept, though), that is:
Presentation <-- Controller --> Abstraction
with incoming user events coming from the Presentation (?).
This make me feel to understand PAC is the same as MVP, where the view is passive. Is this a correct interpretation of these two patterns?
[*]: unlike with MVC, where user events comes from the Controller
PS Is this OK to ask a general question about design patterns on Stackoverflow? Or is there a better place? I have a doubt, as that's more a design than a programming matter.
The difference is in how the application is structured. While MVC and other MVC-inspired patterns have only single triad, the PAC structure is hierarchical.
What you get is a tree of Control
instances, which assemble the application.
In each of those triads the Control takes data from Abstraction and places it in the Presentation.
There is also the HMVC pattern, which is a bit different interpretation of PAC pattern, where Control (renamed as Controller) only is supposed to manipulate the state of Presentation (renamed as View) and Abstraction (the Model layer). In this case the views communicate with model layer directly and extracts what it needs.
Basically, PAC is distributed MVP and HMVC is distributed Model2 MVC.
链接地址: http://www.djcxy.com/p/5120.html上一篇: 在PowerShell中运行时,为什么'where'命令不显示任何输出?
下一篇: PAC,只是被动观点的MVP?