Dealing with objects not yet in a context (or shouldn't I ?)
Dealing with objects not yet in a context (or shouldn't I ?)
- Subject: Dealing with objects not yet in a context (or shouldn't I ?)
- From: Yann Bizeul <email@hidden>
- Date: Sun, 27 Aug 2006 12:52:44 +0200
Hi list,
Here is the scenario :
User <-->> LocationTagUser <<--> Location
Basically, Users does have different Locations for which they assign
their tags (keywords, or whatever). I would be pleased to have a
flattened relationship between Usres en Location, but since I have an
additional attribute in the linking table, I can't, that's ok.
Now, a user does want to add a location, but before adding a
duplicate one, we check the database to see if it (the Location) does
not exists yet, and ask the user to choose among existing ones.
But I did the choice to not insert my temporary Location object the
user is adding until I'm sure it is not a duplicate one, insted of
adding it in the session's default context, and remove everything in
case he choose an existing one (and remove Locations and associated
LocationTagUsers) to replace with the existing object relationships.
But that causes problems with Location's methods involving
EOFetchSpecification.
Is this a wrong approach ? should a temporary object be part of the
editing context as soon as it is born ?
What is the best way to manage such "temporary" objects with their
relation to make the code as simple as possible ?
Thank you
Yann Bizeul • yann at tynsoe.org
Cocoa Developer
Tynsoe Projects
BuddyPop • GeekTool • SSH Tunnel Manager • ...
http://projects.tynsoe.org/
_______________________________________________
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