Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 10th, 2007, 03:13 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

adh - from the book:

The DataAccess class (located in /App_Code/DAL/DataAccess.cs) contains just a few properties, such as ConnectionString,EnableCaching,CachingDuration and Cache, and the ExecuteReader, ExecuteScalar and ExecuteNonQuery wrapper methods discussed in this chapter. Note that, except for the Cache property that just returns a reference to the current context's Cache object, the properties are not set directly in the class itself because they may have different values for different DAL classes. I don't plan to use the cache from the DAL because, as I said earlier, I prefer to implement caching in the BLL so it works regardless of which DAL provider is being used. However, I've put the caching-related properties in the DAL's base class also, in case there may be a need for some very provider-specific caching someday.

the case is made for caching in the BLL for good reason. of course, being 'pattern based', the cache could conceivably be actioned in the DAL. for me, it kinda makes sense having it in the BLL as i may well want to do further 'stuff' on this cached data whilst inside the confines of the BLL.

jimi

http://www.originaltalent.com
 
Old October 10th, 2007, 03:57 PM
ADH ADH is offline
Registered User
 
Join Date: Apr 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Both the last to messages are just expressing what I tried to say.
BLL.ForumsBase class does not implement System.Data (and it should not) because it (dataset) is a DAL asset. Me too I don't to bring it there. So I am asking about a bypass to cache the dts not in the BLL.
You just clarified the problem (so as I understood it).
ADH
 
Old October 10th, 2007, 04:02 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

ADH - the cache (in c# anyway) doesn't store/retrieve a dataset to/from the cache. it stores and retrieves a <List> of the DAL entity classes.

it might be helpful (certianly for me), to give a step by step guide as to what you want to do. that way, we can tackle each step at a time.

jimi

http://www.originaltalent.com
 
Old October 10th, 2007, 04:42 PM
Friend of Wrox
 
Join Date: Mar 2006
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

jimi, you cache a object! This object could be a List/Dataset/String any object!

ADH, finally i understand you!
You are thinking (wrongly) two things:
-Cache in DAL is wrong (yes it is)
-CALL dataset to BLL is wrong (no it's not)

If you google some pages for "dataset/datatable vs list(of T)" we will read hundred of people defending one and other...
See this: http://weblogs.asp.net/bsimser/archi...inglist-t.aspx

We need to import system.Generic in bll to run list! So... why are you so reticent about import system.data

Data shouldn't be used only in DAL!
All your site layers is about DATA ;)

For example I imported to system.generics in some of aspx code-behind! Because in my ModeratorsAdmin Page i have a gridview inside 3 repeaters!
Forumcategories
  ForumForum
  (moderators)
    ForumSubForum
    (moderators)

So i need to imports system.generic to catch my list(of T) from code-behind (and BLL)

If i used Datasets for all I needed to import system.data in DAL, in BLL and in some codebehind pages from UI!!

If you need to choice between (import system.data in BLL or Cache in DAL) please import System.Data in BLL ;)

I hope it helped you!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill a DataSet from another DataSet kamranzafar C# 1 February 7th, 2007 11:14 AM
Fill(dataset) or dataset.load() salemkoten SQL Server 2005 1 November 2nd, 2006 11:04 PM
Converting a untyped dataset to a typed dataset daphnean Visual Studio 2005 0 July 13th, 2006 01:16 AM
Copy dataset to another dataset kapila VB.NET 2 November 13th, 2005 06:25 AM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.