Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You’ve almost finished enhancing the sample application. The last part that needs to be updated is the comments view. You’ll start by creating an MVP triad just as before. Later you’ll add a modal pop up to add new comments and edit existing comments. Let’s get started.
Creating the Presenter for the comments view of the application will be just like creating the last two Presenters. The CommentsListPresenter will be responsible for maintaining more state than the previous Presenters. It will need to maintain a reference to not only the currently selected issue, but also the currently selected comment, to properly persist the Comment objects. Because the code for the CommentsListPresenter is rather lengthy, we’ll break it up. The following listing shows the first section in which you define which events this Presenter will listen for and a couple of get/set properties.