Skip to content
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

Add utility methods for startLRA and joinLRA not containing timeout parameters #44

Open
xstefank opened this issue Nov 19, 2018 · 9 comments
Milestone

Comments

@xstefank
Copy link
Member

Posting this as a question to the community. There is an idea to add overloaded variants of startLRA and joinLRA methods that do not contain timelimit and time unit parameters that would mean that by the default no timeout should be used. Such methods can help with repetitive unnecessary attributes in the user code, but on the other hand will make the client API more complex. There is a reasonable trade-off so we would like to ask for the opinion in the community.

@xstefank
Copy link
Member Author

A side note a LRAManagement interface already contains such utility method without timeout for the joinLRA case

@tomjenkinson
Copy link
Contributor

I think we should remove joinLRA from the LRAClient api then

@xstefank
Copy link
Member Author

@tomjenkinson sorry I don't understand what you mean, joinLRA in LRAClient is required for programmatic API.

To the original question, I think the added complexity which would be introduced by these usability methods can be removed by default implementations in the LRAClient interface and the benefit for the end users can be very valuable as timeouts are just not necessary every time.

I also checked other MP specifications and there is no similar example of such extensive interface, but if you prefer we can still take this conversation to the MP mailing list.

@ochaloup
Copy link
Contributor

Tjos sounds as a good idea to me. It's a pleasant UX benefit.
The need to write the timeout for each API call is pretty boresome from user perspective. It's a good practice to provide a way to call the function without default valued parameters being required.
Currently the user has to search for default timeout value to pass it to the methods even he does not care about timeout at all.

@mmusgrov
Copy link
Contributor

Note that we should be encouraging the use of annotations over the programmatic API.

@ochaloup
Copy link
Contributor

I think encouraging annotations has nothing in common with fact to make our API nice to use.

@mmusgrov
Copy link
Contributor

Adding too many utility methods just makes the interface noisy, but if that's what people want.

@ochaloup
Copy link
Contributor

I would argue it's usual way to make the AP not noisy but easier to use. It's way to help the user. But I agree this could be matter of taste. You can check e.g. java APIs String, StringBuffer all the functional of(...) methods etc.

@mmusgrov
Copy link
Contributor

mmusgrov commented Nov 28, 2018

+1

@xstefank it looks like you have a +3 on this issue which is enough to go ahead with a PR (and we don't need to go to the MP mailing list).

xstefank added a commit to xstefank/microprofile-lra that referenced this issue Dec 3, 2018
xstefank added a commit to xstefank/microprofile-lra that referenced this issue Dec 3, 2018
@mmusgrov mmusgrov added the 1.0 label Dec 3, 2018
@mmusgrov mmusgrov added this to the 1.0 milestone Dec 5, 2018
@mmusgrov mmusgrov removed 1.0 labels Dec 5, 2018
@mmusgrov mmusgrov modified the milestones: 1.0, 1.x Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants