• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Some MVC questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Some MVC questions (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: [Seriously OT]Mac.com 60 days and counting
  • Next by Date: iTunes Plug-ins (non-visual)
  • Previous by thread: Some MVC questions
  • Next by thread: Re: Some MVC questions
  • Index(es):
    • Date
    • Thread