Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I prefix my method with "get" or "load" when communicating with a web service?

I'm writing a desktop application that communicates with a web service. Would you name all web-service functions that that fetch data LoadXXXX, since they take a while to execute. Or would you use GetXXXX, for instance when getting just a single object.

like image 587
RichRaa Avatar asked Dec 05 '25 06:12

RichRaa


1 Answers

Use MyObject.GetXXXX() when the method returns XXXX.

Use MyObject.LoadXXXX() when XXXX will be loaded into MyObject, in other words, when MyObject keeps control of XXXX.

The same applies to webservices, I guess.

like image 170
Jorge Alves Avatar answered Dec 09 '25 00:12

Jorge Alves



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!