passive view and display logic

Posted by genesys on Stack Overflow See other posts from Stack Overflow or by genesys
Published on 2010-04-19T15:30:42Z Indexed on 2010/04/19 15:33 UTC
Read the original article Hit count: 358

Filed under:
|

Hi!

In MVC and MVP and similar patterns there's often the approach of the "passive view" which is as stupid as possible. This should facilitate unit testing and create a clearer separation of view and model.

I know that those patterns come in very different flavours and especially the understanding of MVP seems to differ from article to article. Therefore my question is not "how do i implement this pattern correctly".

I want to improve view and model separation and go for better testability of the application. Therefore i'd like to go for a passive view. But my question is, where would you put logic that is clearly only view related? like a textviewer should scroll the text when the scrollbar is moved. would you put the logic for this into the Presenter? Let's say the textviewer has some extended functionality. like setting markings on textpassages. The logic for this makes clearly sense to be put into the Presenter. However, if it is mixed with all the 'direct' logic of the view (like scrolling the text) the Presenter could become very big, which is also not really a nice design.

So my question is where to put display related logic of a passive view and what functionallity to mix in the Presenter.

Thanks!

© Stack Overflow or respective owner

Related posts about passive-view

Related posts about logic