Composite Views & Composite Presenters
I found M. Fowler article on Passive View pattern. I would like to apply it in my application. I use Swing for UI. I spent several hours searching tutorials or examples how to implement it but not much useful found. Could anybody help to understand the design or provide good examples here? By "M" in MVP I understand "Domain Model".
MVP = Model View Presenter
The basic idea is, that you separate presenting logic from UI (view), so you can mock out the view and test presenter with simple JUnit tests, instead of messing the swing (probably generated by designer) code with your "view logic" (code that controls the UI)...
http://www.youtube.com/watch?v=PDuhR18-EdM
Really nice presentation by Ray Ryan. He talks about GWT, but the idea of MVP is well explained...
MVP starts at 21:30
MVP can be explained the following way:
Model -- the domain model of your application. All business logic is here.
Presenter -- All view logic is here. Retrieves data from model and updates the view.
View -- UI presentation. Contains no updating logic. Fires events to the presenter on user interaction something and listens to the events from the presenter.
链接地址: http://www.djcxy.com/p/30224.html上一篇: 模型数据和行为的放置位置?
下一篇: 复合视图和复合演示文稿