Skip to content

ConnectionFactory: fluent style #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rrrrrrrrramba opened this issue Nov 9, 2017 · 5 comments · Fixed by #1038
Closed

ConnectionFactory: fluent style #330

rrrrrrrrramba opened this issue Nov 9, 2017 · 5 comments · Fixed by #1038
Assignees
Milestone

Comments

@rrrrrrrrramba
Copy link

It would be useful if the API of ConnectionFactory supported fluent style. For example:

Connection c = new ConnectionFactory().setUri(...).newConnection();
Connection c = new ConnectionFactory().load(...).newConnection();

Most of the times, this involves returning this in the setters.

I know this might be a personal opinion, but what do you think?

@acogoluegnes
Copy link
Contributor

Good idea. NioParams, introduced in 4.0, already uses a fluent API. This is a breaking change though, so it must be introduced in the next major release, that is 6.0.

@rrrrrrrrramba
Copy link
Author

Great, thanks!

@enniokerber
Copy link

Hey @acogoluegnes,

I feel like this might be a topic suited for an Open-Source beginner. Would you mind assigning this to me? I'd be eager to work on it.

Greetings,
Ennio

@michaelklishin
Copy link
Contributor

Thanks for contributing, @enniokerber. @acogoluegnes perhaps we can ship a small (source-level) backwards compatible like #1038 in 5.18?

@acogoluegnes
Copy link
Contributor

#1038 is not exactly a backward-compatible change: applications or libraries using reflection could depend on the method return type. This is very unlikely though, so I'd say we can backport this to 5.x. Is that OK with you @michaelklishin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants