Re: Help with code screen using model-view-controller
Re: Help with code screen using model-view-controller
- Subject: Re: Help with code screen using model-view-controller
- From: "Pierce T. Wetter III" <email@hidden>
- Date: Fri, 2 Jun 2006 16:23:36 -0700
On Jun 2, 2006, at 3:00 PM, Art Isbell wrote:
On Jun 1, 2006, at 10:23 AM, Carter Wojcik wrote:
Does anyone know of a good reference or examples that
can demonstrate model-view-controller?
I have found WO apps to be much more difficult to model using MVC
than Cocoa apps.
Personally I've always found MVC to be a myth even in Cocoa.
Model, sure.
V+C, depends on the app.
I mean yeah, an NSColorWell is definitely a "view". But the window
that holds that NSColorWell often functions as both view (adjusting
the presentation) and controller (implementing logic related to the
view).
Not to mention "Facade" classes like NSNumberFormmatter because
often you have to translate between the actual data and the
representation for the user.
Now we have MFVC: Model, Facade, View, Controller
Is the "document" class in Cocoa part of the facade, the view or
the controller?
Seems to depend on the app.
Similarly, components tend to be pure view, but pages tend to be
view+controller, just like NSDocument ends up doing double duty.
Ok, enough philosophy, answering the actual question...
Model: An NSColor.
View: An NSColorWell
Controller: The code that notices when the value in the NSColorWell
changes, updates the model, and applies the color change.
Pierce
WOTip: Have a common superclass for your components, pages, and
EOObjects. It will help you be DRY
More Tips: http://www.twinforces.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden