CSLA .NET

From Rockford Lhotka's Expert C# 2008 and VB 2008 Business Objects books

Cached lists

rated by 0 users
This post has 0 Replies | 1 Follower

Not Ranked
Posts 5
eDjinn Posted: Thu, Sep 13 2007 9:13 AM
Using the Codesmith templates (based CSLA2.x CS 1.1.0 RC), I like the choice I have generating a single, SplitPartial of SplitBase class.
What we use a lot in our code, is static lists (that is: lists that don't change a lot, like storage places in a a warehouse.
Maybe I can suggest a change here in the templates:

ReadOnlyRootList and ObjectFactoryMethods:

private static _cachedList = null;
public static (bool useCache 0) { %>, )
(...)
if (_cachedList == null || !useCache)
_cachedList = DataPortal.Fetch>(new FilterCriteria());
return _cachedList;



EditableRootList:

protected override void DataPortal_Update()
(...)
_cachedList = null;
RaiseListChangedEvents = true;


Using these changes, most lists will be cachable by choise.

Any comments?
Page 1 of 1 (1 items) | RSS

Please contact Magenic for your .NET consulting
and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems