Multiple controllers vs multiple categories (or tips for large projects)
Multiple controllers vs multiple categories (or tips for large projects)
- Subject: Multiple controllers vs multiple categories (or tips for large projects)
- From: Keith Blount <email@hidden>
- Date: Thu, 20 Jan 2005 12:04:41 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hello,
I would be grateful for some advice on the best way to
structure large projects.
My project has grown and grown in the months that I've
been working on it, and I'm now wondering if the way I
have structured my code is rather clunky and needs
reworking.
My app is document-based, and each document window
contains an outline view and a split view that
contains tab views, which in turn contain a number of
views - a table view, text view, web view, image view,
etc. This means that each document is controlling a
*lot*. I asked for advice on the best way to structure
long projects some time ago, and someone kindly
suggested categories, which seemed a good idea. I thus
broke MyDocument (yes, I need to rename it to
something more meaningful) into a number of categories
(probably nearing 20 now), such as MyDocument
(OutlineView), MyDocument (Toolbar), etc, each dealing
with different aspects of the document.
Is this good practise, or is this (as I suspect it
might be) a bad use of categories? Should I be using
multiple controllers instead? ie. Should I have a
controller for my outline view and have MyDocument
work with that controller instead?
That seems the more modular approach, but then all of
my controllers would need to talk to one another - for
instance, if the user selects something in the outline
view, that informs the tab view which subview to
display, and the subview what information to display,
which is why I at first thought the controllers route
might be more complicated as they would have to know
about each other anyway.
This is probably a fairly basic question, but it's not
something that is covered in any of the books,
examples or tutorials I have read because they all
deal only with short examples rather than large
projects.
Basically, I am just asking what is good programming
practice in Cocoa for splitting up very large projects
into managable chunks of code.
Many thanks for any advice,
Keith
__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250
_______________________________________________
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