[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.caching

Question on caching and application tiering in ASP.NET 2.0

(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

1 Answer

offwhite

9/25/2006 8:17:00 PM

0

While the caching features are in the System.Web namespace, you are not
required to use them within a web application. In fact, you can use
them on a console application or bury them safely in a library used in
a different tier of your application.

User this code to get a reference...

Cache cache = HttpRuntime.Cache;

>From there you can map your dependencies and invalidate the data on
data/domain tier and only expose the public interface of your business
objects.

Brennan Stehling
http://brennan.offwhite...

intrepid_dw@hotmail.com wrote:
> 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