I have a small project that I want to rewrite using the MVP pattern. Project on the Windows Forms platform. I studied some literature, I understand the organization of classes in the examples explained, but I can’t apply to my task, it turns out some kind of porridge. Please explain how to organize classes for my case with the task. The purpose of the project is as follows: several files or a folder with files (for example, the user selects files using the OpenFiles / OpenFolder dialog) goes to the input, then I need to process each file and find some errors in each of them. After processing, I need to display a list of errors in the context of files.

I organized the following classes: View, Presenter and Model. View is a form, I scribbled some interface on it, after selecting the files, I pass an array of strings with the paths to the selected files to Presenter, from Presenter I call a method in Model that loops each file in the verification method and returns an array of errors. Now all the same, my logic is not divided, the View is working with visual components. I read in the sources that in the View a minimum of operations should occur.

  • one
    Watch this video tutorial . very simple and easy to understand in Russian, MVP applied to Windows Forms is explained on a concrete simple example. Yes, and in general the channel is very good and useful. - Bulson
  • Look here.stackoverflow.com/a/572971/198316 , possibly double - rdorn

0