[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Should PRIVATE STATIC be preferred over PRIVATE when...

  • Thread starter Thread starter marian.edu
  • Start date Start date
Status
Not open for further replies.
M

marian.edu

Guest
[quote user="Lieven De Foor"] I'm thinking quite the opposite about the use of FINAL/PROTECTED recently and would favor using final with composition/delegation and as little protected members as possible (private and public only). [/quote] Hmm, I see now how mentioning PROTECTED made you thing inheritance vs. composition is what I had in mind but this is not the case nor will FINAL will favour composition albeit it will prevent inheritance :) Using PROTECTED instead of PRIVATE will let you write unit tests for those methods by simply extending the class for test purposes and imho there is really no gain in forbidding other developers extend/change functionality of your code if they see fit.

Continue reading...
 
Status
Not open for further replies.
Back
Top