1

Is there a generally accepted term for a method that does nothing more than calling another method (and returning its result)?

  • 2
    Think there may be a name in some circumstances depending on the context-- facade, wrapper, invoker, empty constructor, etc. Do you have any specifics? – John Wu Oct 22 '18 at 8:50
  • Somewhat related post: softwareengineering.stackexchange.com/questions/141251/… – Phil N DeBlanc Oct 22 '18 at 9:00
  • @JohnWu: In automated testing, in order to be able to test a protected method, one could inherit from the class under test and provide a public function (X) that calls the method you want to test. When doing this, I wanted to make clear in the name of method X that it's just that: a method that calls another method. – bvgheluwe Oct 23 '18 at 8:41
  • The method would be called "a public member that hides a protected member of the same name." The class containing such a method would be called a shim. – John Wu Oct 23 '18 at 9:30
3

By itself, such a function would be a wrapper function. These are normally used to hide an ugly API or obsolete function names.

A more sophisticated object-oriented wrapper may be designed as a facade or adaptor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.