to MVC or not to MVC

Oswald Buddenhagen ossi at kde.org
Mon Jan 5 09:20:35 GMT 2009


On Mon, Jan 05, 2009 at 03:28:58AM +0200, Nick Shaforostoff wrote:
> it makes a switch from qlistvew+model to qlistwidget+qlistwidgetitems
> 
> while making the file ~800 bytes smaller, it adds additional overhead
> of creating and storing qlistwidgetitems @runtime.
>
i find it rather amusing to read about the overhead of creating
widgetitems while your model implementation did a linear stringlist
search for every single checkstate data fetch.

> although the previous version was a bit longer, it used standard MVC
> code structure -- easy to grok (and change/maintain) for anyone who
> understands MVC.
>
making code buzzword compliant is not a goal, even if everyone involved
"groks" it. MVC should be chosen (and done right, heh) if the
transformation between widgetitems and the native model is a) a
performance problem (be it cpu or ram) or b) it "feels artificial" (*),
neither of which is the case here.
as far as "easy" goes, i have to wonder why you didn't manage to make a
correct, let alone accurate transformation then? maybe the actual code
matters more than the design pattern?

(*) this list does not claim to be exhaustive.




More information about the kde-core-devel mailing list