Reputation: 15018
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.
Upvotes: 1
Views: 228
Reputation: 86409
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.
Upvotes: 15