(David Whitney)
9/12/2006 6:56:00 PM
Hello, all.
I'd like to ask a question about the structure of a .NET Web
application and how ASP.NET 2.0 implements SQL cache invalidation.
MS provides an ObjectDataSource class to leverage existing external
"business objects" used to get data from a database. That class
supports a SqlCacheDependency property wherein you identify the table
name with which the object is associated. So far so good, but...
Now, here's where I'm having a problem. My business object exists
because I want my application in tiers, as the conventional wisdom
holds. That said, it appears that I end up (or at least coming pretty
darned close to) breaking my "tiering" by hard-coding an actual
database and table name in the SqlCacheDependency property of that
ObjectDataSource. Put another way, I'm exposing/hard coding database
details declaratively to use an object that exists, among other
reasons, to keep specific data like that out of the web application.
Perhaps I'm simply not understanding something correctly, but at a
glance this this seems out of whack to me, although it could simply be
that I'm the one who is out of whack :0). It would seem that, in this
case, using the non-SQL-based caching of the ObjectDataSource might be
a better path for preservation of application tiering.
So, my specific questions are:
1. Is my understanding of the ObjectDataSource correct?
2. Is my understanding of the SqlCacheDependency property correct?
3. Is the hard-coding of database/table names in this instance not
really considered a breaking of the desired tiering?
I appreciate any thoughts, suggestions, or corrective comments anyone
might have.
Thanks,
-intrepid