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

provide non-static API access #93

Open
tubbynl opened this issue Jun 1, 2018 · 12 comments
Open

provide non-static API access #93

tubbynl opened this issue Jun 1, 2018 · 12 comments
Milestone

Comments

@tubbynl
Copy link
Contributor

tubbynl commented Jun 1, 2018

Currently the java client API is purely based on static access and is based on a SingleTon ApiContext

Static functions don't give a lot of flexibility in usage, i would like the ApiClient to with it's own private final context and providing access to the different API's using that context.

Would you guys consider providing a BunqApiClient having methods-per-concept?
for example:
https://github.com/stil4m/mollie-api/blob/master/src/main/java/nl/stil4m/mollie/Client.java

current static API can be retained for backwards compatibility via these concepts

It would enable better integration in inversion-of-control / dependency injection (spring beans..) scenario's

@tubbynl tubbynl changed the title API static access provide non-static API access Jun 1, 2018
@OGKevin
Copy link
Contributor

OGKevin commented Jun 1, 2018

There was already a request for this, see #34 but after internal discussion we concluded that we won't do this. But that was based on the argument for testing. As it will require a giant refactor.

@tubbynl
Copy link
Contributor Author

tubbynl commented Jun 1, 2018

Would you accept a pull request on this?

@OGKevin
Copy link
Contributor

OGKevin commented Jun 1, 2018

Hmm, if its nicely structured and can be implemented in the other 3 SDK's then i don't see why not. But i think it would be better if you give some pseudo code on what you have in mind.

@OGKevin
Copy link
Contributor

OGKevin commented Jun 1, 2018

I have a feeling that the generated code must also change for this.

@tubbynl
Copy link
Contributor Author

tubbynl commented Jun 1, 2018

the generated code only resides in src/main/java/com/bunq/sdk/model/generated right?

@OGKevin
Copy link
Contributor

OGKevin commented Jun 1, 2018

yes, which means i would have to make some changes to the generator.

@tubbynl
Copy link
Contributor Author

tubbynl commented Jun 1, 2018

Let me first look into it, perhaps that won’t be required

@tubbynl
Copy link
Contributor Author

tubbynl commented Jun 1, 2018

nope; that's required, maybe the code-generation part should also be shared? it will probably be based on a (kind of) wsdl describing the service?

@OGKevin
Copy link
Contributor

OGKevin commented Jun 1, 2018

WSDL ? 😂 nah.

But no, unfortunately we cant share the code for the generator 😉. So, if you provide some pseudo code so that i can have a look. I'll see if its something we want to do or not. And if so, ill make sure the generated code is compatible.

@tubbynl
Copy link
Contributor Author

tubbynl commented Jun 1, 2018

i'll fiddle some in a pull request :)

@OGKevin
Copy link
Contributor

OGKevin commented Jun 4, 2018

@tubbynl thanks For the PR. The structure makes sense. As this is a giant restructure of all 4 sdk's. Ill plan this for 2.0.0.

@tubbynl
Copy link
Contributor Author

tubbynl commented Jun 4, 2018

yes, i guessed that, if you want help testing/reviewing stuff i'm available, for now i'll implement with current state

tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 14, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 17, 2018
UserContext building without static references, backwards compatible
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 17, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 17, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 17, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 17, 2018
BunqHeader, and added some junit tests on it
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 17, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 17, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 17, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 17, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 18, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 18, 2018
less complexity, risk for nullpointers is the same as before
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 18, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 18, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 18, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 18, 2018
at the cost of risk for index-out-of-bounds (prior code)
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 19, 2018
at the cost of risk for index-out-of-bounds (prior code)
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 19, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 19, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 19, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 19, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 19, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 19, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 19, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 19, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 20, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 20, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 20, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 20, 2018
OGKevin added a commit to tubbynl/sdk_java that referenced this issue Jun 20, 2018
OGKevin added a commit to tubbynl/sdk_java that referenced this issue Jun 20, 2018
tubbynl added a commit to tubbynl/sdk_java that referenced this issue Jun 20, 2018
OGKevin added a commit to tubbynl/sdk_java that referenced this issue Jun 22, 2018
OGKevin added a commit that referenced this issue Jun 22, 2018
UserContext building without static references. (#93)
OGKevin added a commit to tubbynl/sdk_java that referenced this issue Jul 11, 2018
OGKevin added a commit to tubbynl/sdk_java that referenced this issue Jul 11, 2018
OGKevin added a commit to tubbynl/sdk_java that referenced this issue Jul 11, 2018
OGKevin added a commit to tubbynl/sdk_java that referenced this issue Jul 11, 2018
OGKevin added a commit to tubbynl/sdk_java that referenced this issue Jul 11, 2018
OGKevin added a commit to tubbynl/sdk_java that referenced this issue Aug 17, 2018
OGKevin added a commit that referenced this issue Sep 4, 2018
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

2 participants