Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Concept of 'ViewController' in a PureMVC application  (Read 6780 times)
eco_bach
Courseware Beta
Sr. Member
***
Posts: 81


View Profile Email
« on: May 21, 2010, 02:03:10 »

Having gone thru most of Apple's Objective-C documentation on 'View Controllers', I am somewhat confused by how this term is used.
Objective C descends directly from Smalltalk so am I correct in assuming that a viewcontroller as used in Objective C is a more 'pure' implementation of what a Controller object should be in any MVC based application?

Initially, in coming from an AS3 and PureMVC framework, I though of ObjC view Controller's as being like composite views that also encompassed some of the responsibility of mediators in a PureMVC based application (handling of initialization, hiding and showing of views)

Has anyone else though about this and has working with other languages with MVC based frameworks influenced how you distribute your logic and responsibilities in Actionscript based projects?
Logged
myIP
Jr. Member
**
Posts: 11


View Profile Email
« Reply #1 on: May 24, 2010, 08:03:53 »

Interesting you posted this the day I was thinking the same thing.  I am also coming from an AS3 environment.  I also noticed the Controller in Objective-C has a different role then in most MVC frameworks I have used.  It seems, so far to me, it acts like a mediator for the Model and View.  And the Model and View do not directly communicate with each other.  There is an experienced developer (Codemonkey) from Ultrashock.com, and he claims that the one thing a MVC framework shouldn’t do, is to have the View write to the Model.  Other then that, most behaviors are permitted between the triad.
« Last Edit: May 24, 2010, 10:14:12 by myIP » Logged
eco_bach
Courseware Beta
Sr. Member
***
Posts: 81


View Profile Email
« Reply #2 on: May 24, 2010, 12:44:19 »

Not sure I agree with Apple's approach but my guess is that it has a lot to do with the template-like nature of most iphone applications. If the majority of your view handling logic sits in the viewcontroller, then it really defeats one of the advantages of MVC, keeping the view components fully modular so they can be swapped out and interchanged.

But perhaps someone with more framework savvy can chime in and tell me why I'm wrong.
Also, I guess maybe its time to have a peak at the ObjC port of PureMVC to see if I can apply it in my projects.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: May 24, 2010, 05:14:15 »

Here is a link to what I could suss out about ViewControllerDelegates:
http://forums.puremvc.org/index.php?topic=1583.msg7191#msg7191

Keep in mind that I am not an Objective-C programmer, but wanted to know how the PureMVC pattern fit with the Cocoa way, so I studied the EmployeeAdmin port to get a feel for it.

-=Cliff>
Logged
Pages: [1]
Print