473,396 Members | 1,743 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,396 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
Nov 16 '05 #1
4 1360
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
Nov 16 '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
Nov 16 '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


Nov 16 '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

Nov 16 '05 #5

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

Similar topics

4
by: Jane204 | last post by:
Hi, How to cache a generic method (not a webmethod) within a class? Thanks a lot! Jane
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...
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...
2
by: Anthony Nystrom | last post by:
Can someone please help me with this... Here is the method and what it needs: Public Sub xyz(sender as object, cbaevent as System.Drawing.Printing.PrintPageEventArge) I am looking for and...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.