473,410 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Help!! Cache a method..

Hi,

How to cache a generic method (not a webmethod) within a class?

Thanks a lot!

Jane
Jul 21 '05 #1
4 1218
Jane204 <ke********@yahoo.com> wrote:
How to cache a generic method (not a webmethod) within a class?


What exactly do you mean? Can you give an example of what you want?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
Jon Skeet [C# MVP] <sk***@pobox.com> wrote in message news:<MP************************@msnews.microsoft. com>...
Jane204 <ke********@yahoo.com> wrote:
How to cache a generic method (not a webmethod) within a class?


What exactly do you mean? Can you give an example of what you want?


Hi,

class Test{

// I want to cache just the following method
void foo(){
// do something
}
}

Thanks.

Jane
Jul 21 '05 #3
hI Jane:

I think now you'll have to define what you mean by 'cache'.

--
Scott
http://www.OdeToCode.com

On 7 Aug 2004 04:54:42 -0700, ke********@yahoo.com (Jane204) wrote:
Jon Skeet [C# MVP] <sk***@pobox.com> wrote in message news:<MP************************@msnews.microsoft. com>...
Jane204 <ke********@yahoo.com> wrote:
> How to cache a generic method (not a webmethod) within a class?


What exactly do you mean? Can you give an example of what you want?


Hi,

class Test{

// I want to cache just the following method
void foo(){
// do something
}
}

Thanks.

Jane


Jul 21 '05 #4
Yes... We do know what a method looks like...
I guess you want to save the results of an expensive operation, so you don't
have to recalculate its value if it gets called again with the same
parameters?
If so, use a HashTable to store the calculation results, and check if you
have an old result in the table before calculating a new one.

Niki

"Jane204" <ke********@yahoo.com> wrote in
news:ba**************************@posting.google.c om...
Jon Skeet [C# MVP] <sk***@pobox.com> wrote in message

news:<MP************************@msnews.microsoft. com>...
Jane204 <ke********@yahoo.com> wrote:
How to cache a generic method (not a webmethod) within a class?


What exactly do you mean? Can you give an example of what you want?


Hi,

class Test{

// I want to cache just the following method
void foo(){
// do something
}
}

Thanks.

Jane

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: daniel.w.gelder | last post by:
Hey again. I'm still working on my functor class, and now it works with method functions too; you pass it the method function, as well as the object you want to be 'this' when the method is...
1
by: Gordon Keeler | last post by:
Hi all. I'm trying to develop an automated method of converting Access (97 or 2000) databases to SAS using DBMSCopy. I've discovered that there is not a rigid standard set to control the naming...
4
by: Jane204 | last post by:
Hi, How to cache a generic method (not a webmethod) within a class? Thanks a lot! Jane
1
by: Jack Addington | last post by:
I am just looking for some advice on naming my methods - I am getting confused as to what some of them mean now I have the following scenario - A Visual Data Object and a Logical Data Object. ...
0
by: Stephen | last post by:
I've found this code to help me with my session logout problem. Before I had a session and when I logged out everything worked fine and I was brought to the log out page but when i clicked the back...
1
by: Chris Calzaretta | last post by:
Hello, I need help with method descriptions for example when i say public var as new object.class and i go var.classmethod
0
by: nagar | last post by:
On some PCs I have my application completely crash (with the standard Windows message) when I make a call to the Help.ShowHelp method to display the help guide Here's the call I make. Form...
3
by: agun | last post by:
Hello, Is it true that Firefox 3 always cache pages so this code just completely ignored in my code: header("Cache-Control: no-cache, must-revalidate"); header("Expires: Sat, 26 Jul 1997...
9
by: ITHELP85 | last post by:
I have a method that returns an ArrayList and in the Main method i want to convert that list to an array. public static void main (String args) { **How can I turn the scoresList which is...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.