Re: MVC paradigm: multiple controllers?
Re: MVC paradigm: multiple controllers?
- Subject: Re: MVC paradigm: multiple controllers?
- From: J Tichenor <email@hidden>
- Date: Sun, 3 Oct 2004 06:19:30 +0100
I too am new to cocoa and am learning as I go, and will probably have
to go back and fix a million mistakes. You can and should use as many
controllers as you need to, but no more. My understanding is the two
mistakes people make are a) putting too much in one controller and b)
creating too many controllers that don't do enough.
I am using NSNotifications to keep all my controllers in sync and so
far it's worked out well. My general philosophy, which may or may not
be right, is that each major view gets it's own controller. I am not
using Bindings yet, and don't know whether one should give every table
in one's interface it's own NSArrayController -- assume so, but again
I'm just learning...
FWIW --
J
Hello,
I would be very grateful for some general advice on
the model-view-controller paradigm as regards multiple
controllers.
I am currently starting work on my first
large(-ish)-scale Cocoa project. I have been learning
Cocoa over the past few months using books such as
Kochan, Hillegass, Anguish et al, and have mostly been
working on small projects with this larger project in
mind. I have created nearly all of the (reusable) view
and model classes I need, and now I have to put it all
together.
My question will probably seem very basic to Cocoa
gurus, but here it is: how do you go about organising
controller classes for a large project? Until now, all
my projects have had one controller class to deal with
everything, which is simple enough. But when I did a
prototype of my project as a document-based app, I
soon noticed that MyDocument was becoming unwieldy, as
it had to deal with file saving, moving the data in
and out of the outline and table views and various tab
views, handling various delegate methods, setting up
subviews, and so on. Do most projects only have one
controller, or do larger projects break down
controllers into multiple classes? Seeing as the
controller class has to move all the model data around
between views, I can't quite see how this can be
split. For instance, in my head it would seem ideal to
have separate controllers for the outline view and
table view, but seeing as the table view displays
filtered data from the outline view, this seems quite
complicated.
...That last paragraph should give you some idea of my
confusion. Just some general advice on organising
controller classes in large projects would be much
appreciated, before I go and throw everything plus the
kitchen sink into MyDocument.
Many thanks for any help,
Keith
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
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