• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Flattened Relationships and storedValueForkey()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Flattened Relationships and storedValueForkey()


  • Subject: Re: Flattened Relationships and storedValueForkey()
  • From: David Avendasora <email@hidden>
  • Date: Thu, 30 Oct 2008 05:24:32 -0400


On Oct 25, 2008, at 10:42 AM, Florijan Stamenkovic wrote:

Without knowing exactly what the problem is, I'd just suggest that you skip flattening in the model, and do it in Java. You'll avoid this problem, and you'll also have more control over value caching (which could be what is producing the erroneous result). While getting the same result.

All the reasons for putting them in the model revolve around convienience, not actual added functionality. Having them in the model gets me some added love from D2JC being able to determine the Class and therefor automatically pick the right UI screen for the result set.



Also, if you're doing this on the client, I definitively recommend using JBND to do it, you'll get (for 5 lines of code or something):
- lazy init of the flattened value
- value caching
- automagic change detection and refreshing (when a relevant change on the keypath changes the cache is release and the value re- evaluated next time you ask for it)

You know, I've always thought that implementing JBND would mean I'd have to not be doing D2JC anymore. I wonder if it will work with D2JC as I'm already subclassing EOGenericRecord to add some things...


F

On Oct 24, 2008, at 11:01, David Avendasora wrote:

Hi all,

I am trying to flatten some relationships for connivence sake. For example:

Here's the structure:

RoutingComponent <<-> RoutingStep <<-> Routing <<-ManufacturingLine

I'm flattening the routingStep().routing().manufacturingLine() relationship on RoutingComponent into simply manufacturingLine().

Sure, I could easily write my own convenience method to do this, but I figured this is exactly one of the things that flattening is for.

The problem is:

foo.storedValueForKey("manufacturingLine") returns null,

But,

foo.valueForKeyPath("routingStep.routing.manufacturingLine") returns the expected ManufacturingLine.

I've made substantial changes to my Veogen templates, but I don't see the standard ones handling this either for flattened relationships.

Am I just horribly abusing flattening?

Dave
_______________________________________________
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




_______________________________________________ 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
  • Follow-Ups:
    • Re: Flattened Relationships and storedValueForkey()
      • From: Florijan Stamenkovic <email@hidden>
References: 
 >Flattened Relationships and storedValueForkey() (From: David Avendasora <email@hidden>)
 >Re: Flattened Relationships and storedValueForkey() (From: Florijan Stamenkovic <email@hidden>)

  • Prev by Date: Re: Best Strategy for Cacheing
  • Next by Date: awake() called twice on page refresh
  • Previous by thread: Re: Flattened Relationships and storedValueForkey()
  • Next by thread: Re: Flattened Relationships and storedValueForkey()
  • Index(es):
    • Date
    • Thread