• 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
Large to-many relationships and caching "Best Practise"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Large to-many relationships and caching "Best Practise"


  • Subject: Large to-many relationships and caching "Best Practise"
  • From: Michael Halliday <email@hidden>
  • Date: Tue, 11 Aug 2009 11:32:20 -0400

Hi List,

Let's say you have in your model:

Customer -->> Transactions 

Since a customer could have 1000's or 10000's transactions ... obviously you wouldn't want to have transactions as a class property on the Customer EO for performance reasons.  Normally you would never want to get at ALL the transactions for a customer at once, but you might want to get "Open" transactions or "Flagged" transactions.  So, for example you could have a method on the Customer EO that just fetches the Transaction with a qualifier as below:

public NSArray<Transaction> openTransactions() {
return Transaction.fetchTransactions(editingContext(), Transaction.CUSTOMER.eq(this).and(Transaction.STATUS.eq("Open")), null);
}

Now, this is all well and good ... but what's the "best practice" for caching this result?  You wouldn't want to bind this method up to a WORepetition for example!  I'd just be curious to see how other people are handling these situations.  Do you cache this stuff in the EO itself ... or do you just limit calls to such methods and cache the return value?  I'm basically describing the role of Core Data's fetched properties.

Cheers,
Michael

 _______________________________________________
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: Large to-many relationships and caching "Best Practise"
      • From: David Avendasora <email@hidden>
    • Re: Large to-many relationships and caching "Best Practise"
      • From: Alan Ward <email@hidden>
  • Prev by Date: Re: Defining child Entities.
  • Next by Date: inline bindings and ognl
  • Previous by thread: Re: Defining child Entities.
  • Next by thread: Re: Large to-many relationships and caching "Best Practise"
  • Index(es):
    • Date
    • Thread