OK, I see what you are saying, and to that I respond, why does every example that I have ever found of how to draw objects in a custom view happen to be a drawing program? :)

And I'm not sure I buy what you are saying, because, just like I mentioned for the Sketch example, what does his program do when the user makes a new window with the same view in it and that view has a different zoom factor, or is scrolled to a different position?

My question remains: where should I keep this information? Surely people draw objects in apps other than drawing programs that are limited to a single view.

I do thank you for your response!

On Nov 25, 2009, at 11:00 AM, David Hirsch wrote:

I think you are missing the point of the quote, which is that drawing programs are an exception to the typical rule that view data must be strictly separated from the model ("However, in this case"). When the model data is all about visual information (drawing), then you have no choice but to violate the rule.

On Nov 25, 2009, at 7:27 AM, Paul Bruneau wrote:

I am also pretty sure that Cocoa Design Patterns does it wrong because it admits such:

The model in this example is deliberately kept simple to preserve the focus on the Controller subsystem. In most applications, properties like rectangles and colors are user interface concerns that don’t belong in the Model subsystem. However, in this case, MYShapeDraw is a drawing program.

This seems like a common problem that I have had with various Cocoa information over the years. Everything is kept simple for the sake of the example, and I am left clueless about the correct way to do it (or I am too dumb to see it). In the quote above, I have learned that the rectangles don't belong in the Model subsystem. OK that's a good start! Now, where do they belong?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to