1

I have seen the following pattern used in several frameworks, where a private method is wrapped in a public method:

public Object method_public()
{
   return method_private();
}


private Object method_private()
{
   return Object;
}

What is this pattern called and when should it be used?

sotn
  • 1,833
  • 5
  • 35
  • 65
  • 2
    Please link to an example where you've seen this used. – Radiodef Apr 12 '15 at 19:45
  • 2
    There are many reasonable scenarios where something like this makes sense. I'm not aware of any particular name for this (not every line of code is a "pattern"). – Marco13 Apr 12 '15 at 20:18

1 Answers1

0

Looks like Delegation pattern. But in very strange manner.

http://en.wikipedia.org/wiki/Delegation_pattern

ar4ers
  • 740
  • 5
  • 19