Cocoaers: Do any of you actually use MVC?

whitesaint

cocoa love
Well I've heard about the Model-View-Controller Paradigm for a while now, and I've never quite frankly used it. TextEdit didnt either. I dont think its a good idea for MVC, especially if you want a dynamic Application. If you have a program based on MVC, the program will keep the data and the view and the controller objects seperate. Thus making it harder to manipulate the data (I know I'm not the only one who has troubles accessing and changing objects within different files.)

Well thats about it for my ranting. Anybody else feel the same way?:confused:
 
I guess I'm sort of on the fence. I notice that as my code evolves, I tend to move towards a MVC paradigm. This happens because I write something that's monolithic and then later discover, "Oh, I need this view for some other data type." So, I separate the view. Then, I discover that I can control some other view with the same controller and I've got MVC.

But I also think that sticking to any sort of coding practice too rigidly results in nasty-ass code.
 
Uhh, yeah. The MVC exists for a good reason. Tying your data to the control that happens to be displaying it is bad form--not that it doesn't work. You're just likely to regret it later.

-Rob
 
In my CS classes, they insist we use this model. To make it worse, we're doing it with Java, and using a hideous GUI simplification toolkit that does a pathetic job of layout. It's very annoying to try and use MVC in situations where it's 100% superfluous. Most of the time, I just write a program how ever the heck I want, and if it turns out that I can generalize some portion for use elsewhere, then I do it. It rarely requires much more work than cut-and-paste and a few parameter changes (at least the way I do things.)
 
Well "quick and dirty" is a great approach if you're doing one off small projects.

If you want your project to be maintainable, your code to be reusable, your life to be bearable, you'll find that discipline and methodologies like MVC are indispensable.
 
Actually, if the world was a perfect place and you could have nearly-perfect frameworks in every OS, MVC shall make porting tremendously easy. The absolutely specific part of an app is the View. That you can almost never port, or, when you do, it is a big hassle for the user (GTK+ on Windows is nasty! and so are XWin apps on MacOSX). I guess that porting from Cocoa to GNUStep should be tremendously easy, but installing GNUStep on Linux or Darwin is not easy, so I haven't had the chance to try...
 
Back
Top