Re: Business Entity Hierarchy OO question
- From: "Todos Menos [MSFT]" <todos_menos_msft@xxxxxxxxxxx>
- Date: 14 Mar 2007 14:44:17 -0700
I don't pee on the carpet
I pee on Microsoft
I call for the resignation of Steve Ballmer.
Only Ralph Nader can save us now.
Nader for CEO '07
Time for 'Regime Change in Redmond'
-Todos
On Mar 14, 10:26 am, "Narshe" <nar...@xxxxxxxxx> wrote:
LINQ probably won't make a difference in this case: it'll just allow
you to express the same thing you're expressing now in a more compact,
elegant syntax.
There is a LINQ to SQL adapter or something like that, that will
create a query that will pull the exact data you need. If you just use
LINQ without that, I'll just loop through your results, and basically
do exactly what I'm doing at the moment anyways.
I guess that is my ideal situation. To have one query that gets
exactly the data I need for the objects I'm accessing in the
hierarchical tree. One way I've seen to do this would be to create a
"view" object that does one specific query and brings back the exact
data you need. So, "Customer" would be comprised of data from the
Contact, Company, Opportunity, etc objects.
I agree with PS, except that I wouldn't call it a "Registry". It's
called cache.
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.
I've thought about doing this, and would be great using SQL 2005 since
there is row level cache invalidation. I've even thought about having
all data go through a service/cache/registry.
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.
Thanks. I have a good idea of where I need to invest more research
time into, and a few ways I can solve this issue.
Oh... and ignore the troll. Every newsgroup has to have a pet, I
suppose. It's just unfortunate that ours pees on the carpet.
Yeah, we need some Resolve.
Thanks.- Hide quoted text -
- Show quoted text -
.
- References:
- Business Entity Hierarchy OO question
- From: Narshe
- Re: Business Entity Hierarchy OO question
- From: PS
- Re: Business Entity Hierarchy OO question
- From: Bruce Wood
- Re: Business Entity Hierarchy OO question
- From: Narshe
- Business Entity Hierarchy OO question
- Prev by Date: Re: Business Entity Hierarchy OO question
- Next by Date: Re: Business Entity Hierarchy OO question
- Previous by thread: Re: Business Entity Hierarchy OO question
- Next by thread: Re: Business Entity Hierarchy OO question
- Index(es):
Relevant Pages
|