Application Design Question
Application Design Question
- Subject: Application Design Question
- From: Jason Taylor <email@hidden>
- Date: Mon, 16 May 2005 23:30:33 -0400
I am developing an application that is currently based around one
major controller class called Manager. Manager controls the main window
of my application, the NSSplitViews in the main window, 5 NSTableViews
in the main window, as well as managing all of the addition,
modification, and deletion of data. I have axillary classes that control
the actual data; ie classes that allow users to add Project objects,
Update objects, Contact objects, etc, but the Manager class still has to
have methods that initialize a new object and add it to the main data
structures. The Manager class is approaching 2000 lines and currently
contains a reference to almost every part of the interface and includes
the main app methods such as awakeFromNib.
How can I extend Manager so that it doesn't have to know about all
parts of my application? For example, I have a sheet that allows users
to add a contact. The sheet has about 20 text fields, each of which
exists as a reference in Manager.h. I use Manager.h to get the values
from the UI and then create a Contact object with them and add it to an
array. This works fine, but every time I add a new UI element to the
app, I have to add references to them in Manager.h (it has over 100 refs
right now) I would like to put all of the UI references into my Contact
class and have it control the sheet and do all of the creation, then
just call the Manager class to add it to the Manager's data structures.
How can I make Manager accessible to the rest of my application? Should
I just add a sharedInstance method to it or is there some other sort of
design paradigm that I should be using? Does anyone know of any example
code that I can use to see how a larger scale application is created? I
am relatively new to Cocoa programming and used Learning Cocoa from
O'Reilly Press to start with, but it only covers small scale apps that
are easy to implement. It doesn't cover modularizing your app, and I
don't know of any Apple code that does either.
Any advice/pointers would be extremely appreciated.
Thanks,
Jason
_______________________________________________
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