Occasionally there will be a method that calls another method and does nothing else. I’ll demonstrate with an example:
void foo() {
bar();
}
void bar() {
// do some actual work
}
Is there some precise terminology that could be used to describe method foo? I’ve sometimes seen these called “bridge” methods, but I know this to be incorrect, since a “bridge method” has a separate, well-defined meaning. Any help is appreciated, thanks.
It’s a Wrapper Function.
Contrary to @scrappedcola’s comment, a wrapper function is not necessarily wasteful and redundant. An instance may satisfy an interface, or forward a call.