• 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: Core Data with OpenGL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data with OpenGL


  • Subject: Re: Core Data with OpenGL
  • From: "I. Savant" <email@hidden>
  • Date: Mon, 12 Oct 2009 16:54:10 -0400

On Oct 12, 2009, at 4:27 PM, Ben Trumbull wrote:

but in this case it must draw itself.

No, it doesn't must do anything. Views draw themselves, model objects are state, and controllers are intermediaries.
...
What problem are you trying to solve by knowingly violating the MVC design patterns ?

Hmmm ... must draw itself? No, from a pure MVC approach, I agree with you 100% that not only does it not "must" but it "shouldn't".


However, it's only fair to point out theSketch example - the quintessential example for drawing applications. The STKGraphic class has draw...InView: methods.

For a drawing app, I can see why it might be considered a cleaner design, despite "knowingly violating the MVC design patterns". A "Shape" knows how - and where - to draw itself - just give it a view. I think it's mostly a matter of personal taste and methodology but it certainly isn't "wrong", which I suppose is why it's now one of the few examples left in the developer examples folder in Snow Leopard.

In theory this violates MVC, but in practice this design approach is much easier to understand and maintain (in my opinion, anyway) for a drawing application like Sketch.

This isn't meant to contradict your overall advice, but I do think an application's architecture doesn't have to *rigidly* adhere to any one design pattern to be "good".

--
I.S.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >re: Core Data with OpenGL (From: Ben Trumbull <email@hidden>)

  • Prev by Date: [Q] How to populate custom button of QuickTime media control?
  • Next by Date: Thread Safety - A Theoretical Question
  • Previous by thread: re: Core Data with OpenGL
  • Next by thread: Re: Core Data with OpenGL
  • Index(es):
    • Date
    • Thread