[haiku-commits] Re: haiku: hrev49568 - src/kits/interface headers/private/interface src/preferences/screen src/apps/deskbar src/apps/webpositive

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 24 Aug 2015 12:00:20 +0200

Am 24.08.2015 um 09:44 schrieb Stephan Aßmus:

Am 24.08.2015 um 08:17 schrieb Adrien Destugues:
Using the MVC approach as Axel suggested: A BSpinner "view" class that
does just the drawing, a "controller" class (implementing the control
aspects: changing the value, incrementing/decrementing, validating
input, and keeping the view and model in sync), and a "model" class
(implements storing the data, formatting it to a string, getting and
setting values).
[...]
IMHO, having the interface classes as they are in Haiku does not prevent
a higher level model/view/controller API on top. And several APIs I came
across do it like that, i.e. SWT+JFace and I believe Qt as well. What I
mean is this: How would just the "view" component of an MVC designed
BSpinner look? Wouldn't it be almost exactly like what we have now? The
same goes for most other "simple" controls. Pretty much the only
difference that could be implemented is how these controls store their
value: It could also be directly via the model class. This becomes more
important with more complex controls, such as BTextView, which is why I
felt I needed to write an MVC replacement for HaikuDepot.

I agree that the view, and the controller part can be very similar.
However, I cannot see how this applies to the model with the classes John just introduced (they definitely won't stay).

A BSpinner class could default to a number spinner model, but it should not export any methods to set/get the maximum/minimum values.

Bye,
Axel.


Other related posts: