Project: mule
Issue MULE-8019: Replace builders with a fluent API
Replace the Builders with a fluent API at an ExtensionManager or Describer level. A mockup to take as reference (not commitment) of what we're shooting for is this: {code:java} public Construct test() { return new DeclarationConstruct("ws-consumer", "1.0").describedAs("Web Service Consumer") .withConfig("config").declaredIn(String.class) .with().requiredParameter("wsdl-location").describedAs("uri to find the wsdl").ofType(String.class).whichIsNotDynamic() .with().requiredParameter("service").describedAs("serviceName").ofType(String.class) .withConfig("newConnector") .with().requiredParameter("wsdl-location").describedAs("uri to find the wsdl").ofType(String.class).whichIsDynamic() .with().requiredParameter("service").describedAs("serviceName").ofType(String.class) .with().optionalParameter("connector").describedAs("The connector to use").ofType(Object.class).defaultingTo(null) .withOperation("consume").describedAs("Go get them tiger!") .with().requiredParameter("operation").describedAs("the operation to execute").ofType(String.class) .with().optionalParameter("mtomEnabled").describedAs("Whether to use mtom or not").ofType(boolean.class); } {code} This should improve usability and reduce the complexity of our own code since now the builder implementation is part of the API
Story points: 13