Re: Dictionaries vs iVars
Re: Dictionaries vs iVars
- Subject: Re: Dictionaries vs iVars
- From: Robert Walker <email@hidden>
- Date: Wed, 27 Jun 2007 17:31:00 -0400
Isn't that "loosely" how NSManagedObject works? Aren't the
properties basically stored in an NSDictionary and read via KVC?
On Jun 27, 2007, at 5:14 PM, Dorian Johnson wrote:
I'm using this approach for a similar purpose. I'm simply doing it
because it makes serialization to file *really* easy. If the
properties are accessed a LOT, you'll run into performance
problems, but it definitely adds some flexibility.
Be careful, though, that you only use this for data objects and
that it doesn't convolute your object heirarchy. If it makes sense
for the objects themselves to perform actions (eg, drawing?), then
it makes no sense to use the dictionary approach.
It really depends on your needs. Run some profiling in shark - I'll
bet that you'll find that about 1% of time is spent on the
dictionary stuff.
On Jun 27, 2007, at 3:54 PM, Gordon Apple wrote:
I'm still toying with the idea of using dictionaries instead
of iVars in
my graphics objects and other types of data objects. My thinking
is to have
only one type of graphic object with a single dictionary and let the
relevant controller dynamically add properties as needed, e.g.,
shadows,
borders, shaders, content (pictures, QT, text, etc.) These can
all be
accessed by key value by the renderer and editor. This seems like
it would
be a tremendous simplification of design and would offer great
flexibility
for later feature additions. It seems like it could simplify the
inspector
interface. It could also make it easy to view data structures
when needed
without having to resort to the debugger (e.g., field maintenance).
I would like to hear any comments on this approach. For example,
performance hits? Has anyone tried this?
_______________________________________________
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:
40mac.com
This email sent to email@hidden
--
Robert Walker
email@hidden
_______________________________________________
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