How to name a static factory method in the utility class?

Posted by leventov on Programmers See other posts from Programmers or by leventov
Published on 2013-10-27T10:48:23Z Indexed on 2013/10/27 15:59 UTC
Read the original article Hit count: 229

Filed under:
|
|

I have an interface MyLongNameInterface with a counterpart utility class MyLongNameInterfaces. What is the best name for a static factory method in the utility class, which creates an instance of MyLongNameInterface?

  • MyLongNameInterfaces.newInstance() -- a new instance of the utility class?

  • MyLongNameInterfaces.newMyLongNameInterface() -- too verbose

  • MyLongNameInterfaces.create() -- create an instance of the utility class? Also, create is not a widely used conventional verb in Java

  • better option?

© Programmers or respective owner

Related posts about java

Related posts about naming