473,513 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is this?

Hey

I've bought the book "ASP.NET 2.0 website programming, Problem, Design,
Solution" and some of its code examples is this code:

protected Cache Cache
{
get ( return HttpContext.Current.Cache; )
}

I've got problems understanding this: "Cache Cache", I guess the first
"cache" here is the datatype? What is the second "cache"? is it the method
name? (I doubt it is the methos name, both datatype and method name is the
same)... And if this was a method then from my understanding there should be
some parenthesis after the method name??

Jeff
Sep 12 '06 #1
3 1359
Jeff,
It's not a method name, it's a property. The way you can tell a
property is that it will have a get and/or set accessor. Basically it's a
shortcut to a value that could be a variable, a constant, or a simple
reference. In this case, it's a shortcut to the Cache to make life simpler
instead of typing out HttpContext.Current.Cache all the time in code.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:uy**************@TK2MSFTNGP02.phx.gbl...
Hey

I've bought the book "ASP.NET 2.0 website programming, Problem, Design,
Solution" and some of its code examples is this code:

protected Cache Cache
{
get ( return HttpContext.Current.Cache; )
}

I've got problems understanding this: "Cache Cache", I guess the first
"cache" here is the datatype? What is the second "cache"? is it the method
name? (I doubt it is the methos name, both datatype and method name is the
same)... And if this was a method then from my understanding there should
be some parenthesis after the method name??

Jeff

Sep 12 '06 #2
It's a property, but I don't think the same case and name exactly as
it's type is a good idea.. even if it will compile. Looks liek
something you'de use maybe in a rendered control so you don't have to
reference the full name every time I guess.
Jeff wrote:
Hey

I've bought the book "ASP.NET 2.0 website programming, Problem, Design,
Solution" and some of its code examples is this code:

protected Cache Cache
{
get ( return HttpContext.Current.Cache; )
}

I've got problems understanding this: "Cache Cache", I guess the first
"cache" here is the datatype? What is the second "cache"? is it the method
name? (I doubt it is the methos name, both datatype and method name is the
same)... And if this was a method then from my understanding there should be
some parenthesis after the method name??

Jeff
Sep 12 '06 #3
Thanks

"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Jeff,
It's not a method name, it's a property. The way you can tell a
property is that it will have a get and/or set accessor. Basically it's a
shortcut to a value that could be a variable, a constant, or a simple
reference. In this case, it's a shortcut to the Cache to make life simpler
instead of typing out HttpContext.Current.Cache all the time in code.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:uy**************@TK2MSFTNGP02.phx.gbl...
>Hey

I've bought the book "ASP.NET 2.0 website programming, Problem, Design,
Solution" and some of its code examples is this code:

protected Cache Cache
{
get ( return HttpContext.Current.Cache; )
}

I've got problems understanding this: "Cache Cache", I guess the first
"cache" here is the datatype? What is the second "cache"? is it the
method name? (I doubt it is the methos name, both datatype and method
name is the same)... And if this was a method then from my understanding
there should be some parenthesis after the method name??

Jeff


Sep 12 '06 #4

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

Similar topics

8
3871
by: Randell D. | last post by:
I have just recompiled, upgraded to PHP 4.3.4. As an exercise (and curiosity) I've decided to test out PDF functions and got the test in the PHP online manual working. I had one problem whereby...
2
3053
by: thecrow | last post by:
Alright, what the hell is going on here? In the following code, I expect the printed result to be: DEBUG: frank's last name is burns. Instead, what I get is: DEBUG: frank's last name is...
220
18810
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
699
33328
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
9
2660
by: Martin Maney | last post by:
In my copious spare time I've been dabbling at getting a computerized version of a board game working. After deciding that tk just made me want to vomit, and wx was like swimming through...
92
6335
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption?...
3
2412
by: Ron_Adam | last post by:
Ok... it's works! :) So what do you think? Look at the last stacked example, it process the preprocess's first in forward order, then does the postprocess's in reverse order. Which might be...
12
11128
by: Dario | last post by:
The following simple program behaves differently in Windows and Linux . #include <stdexcept> #include <iostream> #include <string> using namespace std; class LogicError : public logic_error {...
30
15389
by: James Conrad StJohn Foreman | last post by:
After 3 years of using DB2 on Linux, I'm leaving my current employers to go work for a SQL Server shop instead. In order to find my replacement, they're trying to put together a set of questions...
2
1627
by: yogesh | last post by:
char TCGI::x2c(char *what) { register char digit; digit = (char) ((what >= 'A' ? ((what & 0xdf) - 'A')+10 : (what - '0'))); digit *= (char) 16; digit += (char) ((what >= 'A' ? ((what & 0xdf) -...
0
7265
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
7388
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,...
1
7111
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
7539
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
4751
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...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3228
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.