The Active Network
ActiveMac Anonymous | Create a User | Reviews | News | Forums | Advertise  
 

  *  

  Properites vs. Methods...
Time: 19:17 EST/00:17 GMT | News Source: GotDotNet | Posted By: Jonathan Tigner

It is an age old debate… we have some fairly good guidelines, but they certainly leave room for improvement. Today at a WinFX API review (for some cool stuff that didn’t make it out in the PDC drop) we had the debate again… Today the APIs look like:

public DateTime GetDisconnectTime();
public TimeSpan GetIdleTime();
public DateTime GetLogonTime();
public SessionStates GetSessionStates();
public WindowsIdentity GetUserInformation();

My knee jerk is to make these properties…

public DateTime DisconnectTime {get; }
public TimeSpan IdleTime {get; }
public DateTime LogonTime {get; }
public SessionStates SessionStates {get; }
public WindowsIdentity UserInformation {get; }

the problem… well, the calls *could* be cross machine…. My worry is if they are cross machine making these guys properties will lead people to write inefficient code (and therefore bring down the wrath of Rico)…

So, my question for you… Based on this very limited data I have given you, what should we do here? Go for properties and hope for the best, or error on the safe side and use methods, something else?

Write Comment
Return to News

  Displaying 676 through 676 of 676
Prev | First
  The time now is 7:40:19 PM ET.
Any comment problems? E-mail us
#676 By 4240821 (82.115.4.230) at 11/8/2025 5:29:40 PM
https://sexonly.top/activ5hcadd1d3d
https://smutty.su/activgeafbche2g
https://sexonly.su/activg1hffg1gbh
https://sluts.su/activche322eh5h
https://sexonly.su/activ131ce542h2
https://smutty.su/active3d2gda212
https://nsfw.su/activ1bcca45d1e
https://nsfw.su/activ35eb415eag
https://sexonly.top/activ144eded1eg
https://sluts.su/activ2h4d5g1fcf

Write Comment
Return to News
  Displaying 676 through 676 of 676
Prev | First
  The time now is 7:40:19 PM ET.
Any comment problems? E-mail us
User name and password:

 

  *  
  *   *