mvp - Exceptions and model-view-presenter (C#) -


I have implemented MVP patterns in my C # form application.

In my case the model is a motor controller laser system, where the model is actually a mask of two other models (like a motor control system, other laser system).

My presenter is the mediator of the model - to see the events and methods that the user interface handles.

Suppose that I think there is a setting for laser power. The user sets it on some value, which is sent to the presenter, which in turn requests the model to send. If the power of the laser is out of bounds then there is an error in my model which is caught by my presenter.

How can I make this message the best intermediary for the user? In my opinion, I thought about making a method; Call it handleError (string message), and the presenter.

This is my first project using MVP, so I have not been able to experience the kind of best way.

In the view, create an asset for an error message, you can set the value of this property from the presenter. Are there. Back in the setter's view for the property, store the value set as a specific property, but additionally add your logic to whatever the user interface needs to do. This view can control the flow coming within it.


Comments