Re: Some MVC questions
Re: Some MVC questions
- Subject: Re: Some MVC questions
- From: Andrew Pinski <email@hidden>
- Date: Thu, 18 Jul 2002 16:20:18 -0400
On Thursday, July 18, 2002, at 03:32 , Koen van der Drift wrote:
Hi,
I have some questions regarding the implementaion of the mvc
paradigm in my app. My app displays a datamodel (a directed
acyclic graph, to be more precisely) in a window. The user can
edit the graph by dragging nodes from a palette (in a separate
window) to the main window, or by selecting the nodes and
delete them, or move them around.
So, this is what I have in mind:
Model: the graph itself - probably a subclass of
NSMutableArray, and each node is a subclass of NSObject.
It cannot and should not be a subclass of NSMutableArray. Read
about class clusters.
It should have (not be) a NSArray for the nodes.
View: MyGraphView, a subclass of NSView. This forwards received
drags and mouseclicks to the graph. And it draws the graph
(actually it tells the graph to draw itself in the view)
Controller: ??? - now I am stuck. What should this class take
care of? Is it an intermediate between the view and the graph,
eg when an object is added or moved?
Your controller is part of the view right now, I don't know if
that is okay?
And how does the palette fit into the MVC scheme?
Any input is appreciated.
thanks,
- Koen.
_______________________________________________
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.