Where to put dataSource routines
Where to put dataSource routines
- Subject: Where to put dataSource routines
- From: "Mike O'Connor" <email@hidden>
- Date: Wed, 24 Apr 2002 23:31:26 -0400
This is a program architecture question. I'm new to Cocoa. I've got a
document whose window contains an outlineView. I'm trying to be true to the
model-view-controller concept. So, I'm trying to figure out where to put the
dataSource methods. They seem like controller functions since they move data
between the model and a view, but they seem like data functions since they
are strictly ways to access data in the model.
My app is document based. The document data is represented by one data
object, which is the root of a tree of data. There is an AppController, but
the controller stuff for the document is in the MyDocument class. So the
choice seems to be between putting the dataSource methods either in the data
object class, or the controlling document class.
The reason I'm torn is it seems like it should be in the controller, but if
I do that, I'd put them there and probably write virtually the same methods
in the data object and the controller routines would be a cover for them. So
why not just put them in the data object, even though in MVC a data object
shouldn't be talking directly with a view?
What's the way to go?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.