Unify API style

Description

Currently two different styles are being used in the cdap API. One is the older, fluent API style (e.g. Flow, Flowlet, Procedure). The other is a newer, configurer based, simple builder style (e.g. AbstractApplication, AbstractService).

They should be unified into the same style to avoid usage confusion.

I propose unify them to the newer, simple builder style, as it involves fewer boilerplate code and easier to add new features. Moreover, it helps reduce the size of api internal classes.

Release Notes

None
100% Done
Loading...

Activity

Show:

Alex Baranau October 1, 2014 at 8:51 PM

+1 to break compatibility

Terence Yim September 30, 2014 at 9:19 PM

Agree that the cleanest approach is to just break the compatibility. Will proceed down that path.

Andreas Neumann September 30, 2014 at 7:35 PM

Adding a new configure() in the same interface will break compatibility as much as changing the existing method. But a new interface seems odd, too. What would you call that? NewFlow? It seems that we will have to break compat.

Terence Yim September 30, 2014 at 6:32 PM

Keeping the old style API will be a challenging. E.g there would be two Flow interface, but the signature of the configure method will be different:

Old:
FlowSpecification configure()
New:
void configure(FlowConfigurer configurer)

The other possibility is to put them into the same interface, however, that would not be backward compatible.

Any suggestions?

Andreas Neumann September 30, 2014 at 6:24 PM
Edited

Agreed, this will improve the API.
Will you keep the old style APIs for backward compatibility?

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Priority

Created September 30, 2014 at 6:21 PM
Updated April 25, 2019 at 8:09 PM
Resolved April 25, 2019 at 8:09 PM