Re: Why is it like this?
Re: Why is it like this?
- Subject: Re: Why is it like this?
- From: Raffael Cavallaro <email@hidden>
- Date: Tue, 31 May 2005 08:44:49 -0400
On May 30, 2005, at Mon, May 30, 10:57 10 PM, Andy Lee wrote: It would be convenient for the objects to have methods like -stringToDisplayInXYZBrowser and -stringToDisplayInABCContextualMenu, but this means model objects would be aware of the specific views they will be displayed in.
One solution would be to have more abstract methods in the Model class - for example -shortString -longString. Then each view's Controller class would call -short/longString as needed.
Another would be a hybrid approach: "Hybrid Models: MVC, strictly observed, is not advisable in all circumstances. Sometimes it’s best to combine roles. For instance, in a graphics-intensive application, such as an arcade game, you might have several View objects that merge the roles of View and Model. In some applications, especially simple ones, you can combine the roles of Controller and Model; these objects join the special data structures and logic of Model objects with the Controller’s hooks to the interface." So you might keep your hypothetical -stringToDisplay… methods in a hybrid Model-Controller class.
regards,
Ralph
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden