Skip navigation.
 
mlRe: MVC view/controller separation question
FROM : Serge Meynard
DATE : Mon Apr 04 16:58:50 2005

On Apr 4, 2005, at 10:39, Keith Blount wrote:

> The only remaining problem is that the text view still
> needs to update all of the ranges to which the notes
> are attached in didChangeText, which should really be
> part of the controller's job. I don't want to make the
> notes manager the delegate of the text view and do it
> all in textDidChange: because that makes everything
> less flexible (the text view would not be able to
> given an arbitrary delegate).


You might consider having the note view objects update their model
counterparts directly, but in your case I'm not sure they could know
when to do so, or figure out (inexpensively) what range they now refer
to. So you might want to make the document your delegate, and have it
handle the updates. The document can perform calculations and talk to
the note manager. If you're worried about the document object getting
"fat", you can also create a separate class to act as "text delegate"
and have it owned by the document.

Related mailsAuthorDate
mlMVC view/controller separation question Keith Blount Apr 4, 12:25
mlRe: MVC view/controller separation question Johnny Deadman Apr 4, 15:14
mlRE: MVC view/controller separation question Keith Blount Apr 4, 16:39
mlRe: MVC view/controller separation question Serge Meynard Apr 4, 16:58
mlRe: MVC view/controller separation question Keith Blount Apr 4, 18:33
mlRe: MVC view/controller separation question John Brownlow Apr 4, 22:28
mlRe: MVC view/controller separation question Keith Blount Apr 4, 23:18