LabVIEW Architects Forum

cancel
Showing results for 
Search instead for 
Did you mean: 

Some thoughts about Accessors Methods

tl;dr

  • Only create accessor methods when necessary
  • Does a client really be need to be able to write any value [at any time]?
  • Consider using protected scope

This is a hand-wavy presentation that recommends some general guidelines to minimize the use of accessor methods in an effort to preserve encapsulation.  There are many valid exceptions to these guidelines which I do not attempt to enumerate, use your head.  Bottom line is, IMO, the convenience of creating and using accessor methods leads to their abuse, which can result in code that is more difficult to maintain over long periods of time, especially in large development teams.

If you read the slides, I recommend having the notes section visible too.  Hope this can be useful to your team too!  Feedback welcome,

Nate Moehring

As presented on Nov 13, 2014

Nate Moehring

SDG
Message 1 of 1
(5,247 Views)