MVC question
MVC question
- Subject: MVC question
- From: Koen van der Drift <email@hidden>
- Date: Sat, 7 Feb 2004 16:07:40 -0500
Hi,
I am revamping/rewriting an old project I worked on a few years ago.
The app basically consists of a main view, and a palette from which the
user can drag and drop items into the main view. However, my app is not
a typical drawing app, the view is just a means to edit the model.
I am trying to apply the MVC paradigm as much as possible, so the main
view gets the drag, and then passes the info from the pasteboard (a tag
to identify what item was dragged) to its viewcontroller. The
viewcontroller then tells the model to create a new object based on the
info on the pasteboard. This all works fine.
What I don't understand yet how to do, is how to pass the location of
the drop to the new object. This info is needed for drawing each object
in the view, but also for clicking in the view to edit an object.
Initially I thought I can pass that info with the info on the
pasteboard to the model, more or less as in the Sketch example. But,
does this info really belong in the model? The objects shouldn't know
where they need to be drawn, the view or viewcontroller should take
care of this. Any suggestions how to approach this? Maybe use a
parallel array that stores the coordinates of each object?
An additional question, since I am rewriting the app from scratch,
would this type of app benefit from using Cocoa bindings?
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.