OS X == Serious MVC

by Jon Davis 28. August 2008 22:39

Another quickie post, as I spend more time on my Mac Mini and tinker with Xcode, it's really starting to sink in that all this talk lately over the last few years about MVC (Model-View-Controller) is really heavily themed in the entire workflow and almost mandatory software architecture patterns in the OS X environment.

You've got Objective-C forcing you to declare your controllers and objects in a very loose fashion, managing everything with delegates and interfaces.

You have Interface Builder forcing you to build out your views with zero application logic but with hooks everywhere. (This unlike the code-behind model in Visual Studio for all views.)

Then on the data side you have Core Data, http://developer.apple.com/macosx/coredata.html, which really goes a long way to facilitating MVC relationships with the views in Interface Builder and with the general flow of the application.

In some ways, I'm reminded of the amount of effort Microsoft has gone through in Visual Studio to support data binding, except there's an incredibly beautiful simplicity yet sophistication about Apple's approach, where you don't just data bind to inject data into a view, as in dumping data, rather you provide the data models and the controllers to handle the delegates and the actions of the view. The implications of these differences can be staggering. And I know that Visual Studio/.NET facilitate delegation for these things (raising events), but the approach is just not as MVC-oriented. Visual Studio doesn't enforce MVC, Xcode/IB does. Visual Studio allows for MVC, that is, but Xcode/IB imposes it--or at least makes it really obvious that it's the best way to work in Xcode.

Which one is better? Neither; Visual Studio offers versatility whereas Xcode/IB offers elegance and predictability. I love them both.


Add comment

(Will show your Gravatar icon)  

  Country flag

  • Comment
  • Preview


Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 

Tag cloud


<<  May 2021  >>

View posts in large calendar