Re: MVC, storing VIEW-specific information and core data
Re: MVC, storing VIEW-specific information and core data
- Subject: Re: MVC, storing VIEW-specific information and core data
- From: "I. Savant" <email@hidden>
- Date: Mon, 9 Mar 2009 15:52:25 -0400
On Mon, Mar 9, 2009 at 3:04 PM, Karolis Ramanauskas <email@hidden> wrote:
> Well, perhaps I didn't explain it well enough.
That's usually the case with technical posts. :-) You know your
project well. Nobody else does, though.
> Let's say, in the future I
> want to have a different View. In that case specific location X and Y for
> this view will mean different things or may not be required at all. Perhaps
> other View will not need background color or border info, etc. Within my
> model objects I just want to store model related information, nothing that
> pertains to a particular view. Nevertheless I would like to store whatever
> view information I have with the document so when I open it that view is
> back to the state user left it at.
Okay, I see your point, but that really *is* model-layer
information. "For THIS persistent representation of THIS persistent
object, there are THESE properties."
In this case, Benjamin's response is the recommended route. The fact
is, you want to store this information. Yes, it's view state, but it's
persistent. How else are you going to store it? Preferences? Some
other external file?
Why??
If you're worried about performance impact (making your model more
complex), I have two very simple words for you: STOP IT.
That's right. Stop it.
No no, just .... just stop it.*
You need to manage and persist this information, right? Well, Core
Data is an object graph MANAGEMENT and PERSISTENCE framework. You're
already storing node information there, so why wouldn't you also store
the persistent view / representation state along with it, where it's
easily managed and retrieved?
Design your model to do the job it needs to do (even if it means a
separate entity to track different states for different views to any
one node), THEN profile the code performance and work from there *if*
there's a problem.
--
I.S.
* Borrowed from MAD TV sketch.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden