i’m implementing bulltain board(or forums) for my website and i’m using MVP pattern in c# and asp.net along with a typed dataset to connect to the database. my problem is that i’m not sure where should i handle the possible errors and validate the incoming/outgoing data. i came up with two different solution:
solution 1:
view: do nothing just pass the data to presenter
presenter: validation and error handling related to model, database and the view
model: do nothing just return data or error from database
solution 2:
view: validation and error handling related to pages and user inputs
presenter: do nothing just be the mediator
model: validation and error handling related to database and model`
so which solution is a better approach??
I woulds personally stand for second solution for
this. As it’s important for simple (f.e typing errors) give the user immediate feedback, not making him wait for response from the model.