Skip to content

Factory Methods

Philippe Marschall edited this page Oct 12, 2016 · 1 revision

It can be convenient to have the factory method to create the interface instance in the interface itself

public interface Demo {

  void blitz();

  public static Demo newInstance(DataSource dataSource) {
    return ProcedureCallerFactory.of(Demo.class, dataSource)
      .withProcedureNamingStrategy(NamingStrategy.capitalize().thenPrefix("sp_"))
      .build();
  }

}
Clone this wiki locally