• 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: Caching with EO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Caching with EO


  • Subject: Re: Caching with EO
  • From: "Jerry W. Walker" <email@hidden>
  • Date: Thu, 4 Jan 2007 11:58:38 -0500

Hi, Gino,

I've worked on what sounds like a similar app recently where a user was in a location identified by postal code and needed to know the closest several offices of an institution. The institution's records contained latitude and longitude data, and the US post office provides a table mapping postal codes to latitude and longitude.

My approach was to read the entire set of institutional records during application initialization, typically 100 to 100K offices and build Java arrays, one for the latitude, one for the longitude and one for a record reference to get the identified office records.

The Java arrays are small and fast, even for a large number of offices. Given a customer's postal code, I would reference a table mapping postal code to lat/long location, I then applied a geometric mapping against each of the latitude/longitude pairs to identify the nearest offices.

All of the code and the cached arrays were contained in a single class file with methods for identifying the nearest n offices and all offices within x miles of the user. The methods would each return an NSArray of office record references which I would build into an EOQualifier for an EOFetchSpec.

The most useful EOQualifier for this purpose is InSetQualifier: "Where a IN (x, y, z)" which comes from code by Pierre Bernard that can be found at: http://bernard-web.com/pierre .

This was a demonstration app for a client, so I didn't include a method to refresh the cache, since it doesn't change very often, but doing so would have been trivial.

I don't know that this is the design problem you're facing, but from your description, it sounded like a similar problem.

Regards,
Jerry

On Jan 4, 2007, at 10:01 AM, Gino Pacitti wrote:

Hi All

Can anybody offer a little help as to a strategy for record access.

I have a table with 28000 records which hold lon lat information to which I have to query during a repetition.

For each record in a repetition I need to access a different table and pull lon lat for each postcode - this could be up to 100 simultaneous requests by individual users.

Is it best to set the entity to Cache in Memory and collect objects or is it better to collect raw rows?

Any help and advise would be appreciated..

Gino


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden


--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems


    email@hidden
    203 278-4085        office



_______________________________________________
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


References: 
 >Caching with EO (From: Gino Pacitti <email@hidden>)

  • Prev by Date: Re: Caching with EO
  • Next by Date: Re: NSTimestamp problem
  • Previous by thread: Re: Caching with EO
  • Next by thread: Re: NSTimestamp problem
  • Index(es):
    • Date
    • Thread