473,378 Members | 1,489 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,378 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 1217
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.