Re: [linux-audio-dev] Re: MVC

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Re: MVC
From: Matthias Kretz (Matthias.Kretz_AT_urz.uni-heidelberg.de)
Date: Sun May 11 2003 - 01:20:34 EEST


On Saturday May 10 2003 23:17, Paul Davis wrote:
> thats not really the question at all. the question is: can i set the
> button ("view") to show some state in the model without it appearing
> that the user pressed the button?

Ok, good. I wrote that, though...

> >class Model
> >{
> > public:
> > Model();
> > private slots:
> > void viewChanged( int value );
> > private:
> > View *_view1, *_view2;
> >}
>
> instant violation of the core of MVC. Models don't know about
> Views.

In what sense? They have to know the interface. You mean they don't have a
pointer to the views?

> that's why MVC is so powerful: you can create multiple views
> (and multiple controls) for the same model without changing anything
> about the model's implementation. it has no clue how its state is
> being presented, and doesn't care. likewise, it doesn't care how many
> different sources there are of state changes. they could come from the
> keyboard, the mouse, a USB device, a MIDI device, a radio interface,
> an ethernet interface etc. etc. each one is independent of all others
> (and often is independent of the views too).

Allright. I just wanted to give a short example of how to do the
"can i set the button ("view") to show some state in the model without it
appearing that the user pressed the button?" with Qt. I didn't want to write
a full MVC example.

-- 
C'ya
        Matthias
________________________________________________________
Matthias Kretz (Germany)                          <><
http://Vir.homeip.net/
MatthiasKretz_AT_gmx.net, kretz_AT_kde.org,
Matthias.Kretz_AT_urz.uni-heidelberg.de



New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sun May 11 2003 - 01:29:05 EEST