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 601 through 606 of 606
Prev | First
  The time now is 10:09:57 AM ET.
Any comment problems? E-mail us
#601 By 4240821 (82.115.4.230) at 8/12/2025 10:37:13 PM
https://www.xfree.com/probtaguaje579
https://www.xfree.com/catspatbibi37
https://www.xfree.com/xelteyblogex845
https://www.xfree.com/bowquitanmau596
https://www.xfree.com/opusinel57
https://www.xfree.com/rijulaword388
https://www.xfree.com/terlambterti384
https://www.xfree.com/sturmotepe698
https://www.xfree.com/prohmestwado279
https://www.xfree.com/ticpersmilil742

#602 By 4240821 (82.115.4.230) at 8/14/2025 6:32:40 AM
https://www.xfree.com/serfplovlasing826
https://www.xfree.com/protabtratro183
https://www.xfree.com/colparami316
https://www.xfree.com/tilekaltse96
https://www.xfree.com/smareasdari797
https://www.xfree.com/pondkooverpai847
https://www.xfree.com/bruduntiltea836
https://www.xfree.com/kpilosurre432
https://www.xfree.com/tiocomnisub727
https://www.xfree.com/flowesetlan377

#603 By 4240821 (82.115.4.230) at 8/14/2025 4:50:55 PM
https://www.xfree.com/vertfectosis722
https://www.xfree.com/ivanfasru930
https://www.xfree.com/ickaposimp624
https://www.xfree.com/reobubele792
https://www.xfree.com/frutxiasilthe1
https://www.xfree.com/repoulmage576
https://www.xfree.com/tioflatazen588
https://www.xfree.com/rhiztazahsound349
https://www.xfree.com/acsweaterde262
https://www.xfree.com/ticdecknasi727

#604 By 4240821 (82.115.4.230) at 8/15/2025 10:34:11 AM
https://www.xfree.com/cossicache876
https://www.xfree.com/lyiroppeadi815
https://www.xfree.com/widistafur877
https://www.xfree.com/rebudesrbotf638
https://www.xfree.com/tiwsinesga642
https://www.xfree.com/tatpevspresik232
https://www.xfree.com/ketprighscenlec6
https://www.xfree.com/alunpumge826
https://www.xfree.com/stapozhimpuu318
https://www.xfree.com/gayvicnaper472

#605 By 4240821 (82.115.4.230) at 8/16/2025 1:53:37 PM
https://www.xfree.com/noutledabo123
https://www.xfree.com/inderdoraj861
https://www.xfree.com/quiviforce846
https://www.xfree.com/dreamboicedre269
https://www.xfree.com/domlionono189
https://www.xfree.com/inderdoraj861
https://www.xfree.com/srivlunggungu154
https://www.xfree.com/miuficaswei115
https://www.xfree.com/webpcekasom807
https://www.xfree.com/mittpirsmadi193

#606 By 4240821 (82.115.4.230) at 8/17/2025 1:06:01 AM
https://www.xfree.com/enizbyby555
https://www.xfree.com/gungepavvi554
https://www.xfree.com/wretmacodic623
https://www.xfree.com/nkilinticos161
https://www.xfree.com/pamoosedi190
https://www.xfree.com/freegcirnesang13
https://www.xfree.com/furtirasis670
https://www.xfree.com/verlerpdoulque130
https://www.xfree.com/malumebest522
https://www.xfree.com/windcativar56

Write Comment
Return to News
  Displaying 601 through 606 of 606
Prev | First
  The time now is 10:09:57 AM ET.
Any comment problems? E-mail us
User name and password:

 

  *  
  *   *