The Presenter

TODO: write about...
  • the Presenter's life cycle
  • releasing all handles in Finalize

In MVP, the Presenter is concerned with managing and coordinating the View with the Model. It is where the presentation logic is placed. The Presenter is a highly testable part of the MVP, and rightly so. If there is anything apt to go wrong with a program, it will happen whenever we have some kind of logical structure happening (loops, if statements and case structures).

The Presenter is not tied to a physical or concrete View; rather, the Presenter is concerned about the View's interface. From that interface, the Presenter will know exactly how to interact with the actual View object, whether it is a real View or just a mocked View that is supplied to the Presenter in the unit tests.

In a DotNetNuke MVP module, the Presenter is not just concerned with the View and the Model. Remember, the Presenter, View and Model together represent the user interface (UI) layer. The UI layer must also work with the business logic layer (BLL) to accomplish its task. The Presenter is the one that must directly work with the BLL. In DotNetNuke, the BLL has traditionally been called the module's Controller class.

Note: The term "Controller" in a DotNetNuke MVP module does not refer to the idea of a Controller in the Model-View-Controller pattern. The MVC's Controller is actually somewhat synonymous with the Presenter in the MVP pattern.

Last edited Jul 3, 2010 at 4:50 AM by dagilleland, version 2


No comments yet.