1 Dec 2000 01:04
Re: Re: Callbacks Again
Jesse Jones <jejones <at> adobe.com>
2000-12-01 00:04:25 GMT
2000-12-01 00:04:25 GMT
>> The view/controller needs three things from the model: 1)
>> notfication of changes so that it can invalidate itself 2) access
>> to the data so that it can render something for the user to see
>> 3) mutators so that the user can change the model. Notification can
>> be handled nicely via callbacks. I can imagine using some some sort
>> of callback architecture to handle the other two but it's not a
>> natural solution and it really seems like overkill when most views
>> will never be reused in other contexts.
>
>Just to illustrate the setup:
>
>--Record.h:
>
>class Record {
> ...
>};
>
>--Model.h:
>
>#include "signal.h"
>#include "record.h"
>class Model {
>public:
> signal<void, Record> sendUpdateToViews;
> void receiveUpdateFromView(Record r) {
> change model to reflect r
> sendUpdateToViews(r);
> }
>};
>
(Continue reading)
RSS Feed