MVC view/controller separation question
MVC view/controller separation question
- Subject: MVC view/controller separation question
- From: Keith Blount <email@hidden>
- Date: Mon, 4 Apr 2005 03:25:39 -0700 (PDT)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hello,
Just a simple design question - I would really
appreciate some advice on getting a view (actually a
set of views) I am working on to fit the MVC paradigm.
The setup is this: I have a text view subclass that
keeps track of a variable number of notes which are
associated with ranges of text within the text view.
It keeps track of them so that it can change the
ranges if text is edited and do custom drawing to
highlight the ranges of text associated with notes.
I also have a margin view in which such notes can be
created, but the margin view is optional.
Currently, my text view holds an array of notes (each
note is an instance of a custom model class that just
holds the string and the associated text range). If
the user adds a note in the margin, the margin calls a
method in the text view to add this note to the array.
If any changes are made to the text view, the text
view sends a notification so that the margin knows to
update the positions of the notes, etc. The notes in
the margin are actually views that keep track of the
note model data held by the text view.
My question is simply one of good design: should the
text view be responsible for keeping track of this
array, as it is currently, or should I set up a
NotesController class to handle this that is
instantiated by the text view, and have my text view
call methods on that?
Many thanks for any advice,
Keith
__________________________________
Yahoo! Messenger
Show us what our next emoticon should look like. Join the fun.
http://www.advision.webevents.yahoo.com/emoticontest
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden