Search code examples
javadesign-patternsmethodsprivate

Java private method wrapping


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?


Solution

  • Looks like Delegation pattern. But in very strange manner.

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