On 2/19/2014, 8:36 PM, "Paul Hoadley" wrote:

Hello,

Say I have an entity Foo.  Often I will override the static createFoo() method 
declared in _Foo.java, perhaps several times with different signatures for 
different uses.  Say Foo has a to-one relationship to Bar, and I supply bar as 
an argument.  I'm a bit inconsistent as to whether I call:

setBarRelationship(bar);

or:

setBarRelationship(bar.localInstanceIn(ec));

in the body of the method, where ec is obviously the EOEditingContext supplied 
as an argument.  I would have thought that doing the latter was more 
convenient, because then the caller never has to worry about whether or not she 
needs to or remembers to localInstance the related object herself.  But I note 
that the built-in templates _don't_ do this, so that _Foo.createFoo() would 
just call setBarRelationship(bar) if bar was an argument.

Are there any gotchas here?  Is it safe to always call localInstanceIn() in 
these static create methods, or should it be left up to the caller?


--
Paul Hoadley
http://logicsquad.net/




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      
(Webobjects-dev@lists.apple.com<mailto:Webobjects-dev@lists.apple.com>)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net

This email sent to ch...@global-village.net<mailto:ch...@global-village.net>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to