Re: Should I use Core Data?
Re: Should I use Core Data?
- Subject: Re: Should I use Core Data?
- From: Scott Anguish <email@hidden>
- Date: Thu, 20 Apr 2006 17:07:40 -0400
On Apr 20, 2006, at 4:37 PM, Joshua Scott Emmons wrote:
The documentation occasionally mentions the hypothetical example
of a Core Data drawing app, but it sure would be nice to have some
sample code, like a CD version of Sketch.
There's nothing about a "drawing app" that makes it inherently CD
friendly or unfriendly. Drawing apps store data like paths, colors,
points, images, and settings. CD can store all of these data
elements with ease. The thing that is making CD a bad fit for your
app is not the "drawing-ness" of it. It's the app's requirement
that it uses a non-core-data native file format and the app's use
of non-object data in its implementation that make it unsuitable
for CD. It could be a word-processor with similar specs and it
would still be equally unsuited for CD.
Actually, that's not a big issue. You could still use CD for the in-
memory representation.
the issue with a drawing program is that the items have a specific,
natural order (the order that they're layered in the drawing). Core
Data doesn't support this automatically. (mmalc is rolling his eyes
because I harp on this particular example with him all the time) At
this point, that is the biggest drawback to using CD for a drawing
type application. Yes, you could stick an "item number" field in the
record and alter that when you move the items forward and backwards
in the display list.. but it is going to have the potential to be
very slow (many items in the display list, send the top to the back
requires each item to be renumbered).
The good news is that there is so much work to a drawing app that is
outside of the actual storage that I'd consider doing the initial
first version/prototype without CD (and without undo). This gives you
the opportunity to learn the ins and out of handling the drawing,
picking, etc..
drawing programs can really have a wide set of model options. From
very simple (which Sketch is) to very complex (double-linked lists,
with shared styles for things like fills, multiple fill styles and
layering for an individual object, grouping, editing within groups).
It really depends on what you're trying to achieve. I think that
needs to be decided before the persistence is. (I spent 12 years
writing complex drawing applications for the textile industry... The
initial version was straight pascal (this was a while ago.. :-) the
second version was ObjectPascal. I regularly made significant
changes to the model in the OOP version before settling on the final
design. this was fairly easy then. Now with Cocoa it'd be even easier.
_______________________________________________
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