Re: Business Entity Hierarchy OO question



"Bruce Wood" <brucewood@xxxxxxxxxx> wrote in message
news:1173855556.202480.255000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


I agree with PS, except that I wouldn't call it a "Registry". It's
called cache.

I misused the terms a little. I meant an object that would talk to the cache
and if the cache doesn't have the object then would talk to the builder.
This way you have one "point of entry" to get an object.

Basically, you load an object into memory only when some code asks for
it. Unfortunately, as is usual in computing, there are competing
considerations:

1) You don't want to load large tables into memory at start up just in
case you'll need them.
2) You don't want to make thousands of calls to the database to
retrieve single rows when you can make fewer calls to return groups of
rows.
3) The more you cache, the less you have to go to the database (over
time).
4) The more you cache, the more stale your data becomes, and the more
likely that the database will change "beneath" your cache, making
updates / writes that your user does conflict with the data in the
database.

For some tables it will be a no-brainer. If they're small and rarely
change, just load them at start-up, cache them, and grab objects as
they're needed.

For other tables it will be problematic: large tables that shouldn't
be read all at once, or tables that change frequently and so shouldn't
be cached for long periods.

Unfortunately there's no one-size-fits-all answer here. One of my apps
loads most of the tables upon first reference (because they're small,
< 1000 rows, and rarely change), but loads others piecemeal because
loading them at startup would cause an unacceptable delay.

Nice reply Bruce.


.



Relevant Pages

  • Re: Business Entity Hierarchy OO question
    ... KEEP DATA IN A DATABASE. ... You get 10 employees with one query, ... you load an object into memory only when some code asks for ... The more you cache, the less you have to go to the database (over ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: A Hacker in Wildflower Stew
    ... > at it on your browser, you -might- be looking at an old version of the ... > page that's been stored in your browser's cache. ... > "load new every time" option, ... you want to use the cache (temporary internet files) ...
    (alt.gathering.rainbow)
  • Re: Some pages now dont load in IE
    ... I use Firefox - and it is an excellent browser. ... > cache and then try again. ... >> don't load in IE. ... Checked okay. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: my paper: A cascade hash algorithm with O(1) worst case lookup time
    ... Is there an upper-bound to the space needed to hold a cascade hash ... How does the average case compare with a linear probing ... assumes that the previous space will run at 50% load -- but that would ... undue load on the system's memory cache hierarchy then it may perform ...
    (comp.programming)
  • Re: Business Entity Hierarchy OO question
    ... There is a LINQ to SQL adapter or something like that, ... you load an object into memory only when some code asks for ... The more you cache, the less you have to go to the database (over ...
    (microsoft.public.dotnet.languages.csharp)