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

Encapsulate everything #3

Open
amihaiemil opened this issue Jan 26, 2019 · 0 comments
Open

Encapsulate everything #3

amihaiemil opened this issue Jan 26, 2019 · 0 comments

Comments

@amihaiemil
Copy link

amihaiemil commented Jan 26, 2019

No Builders, no Service classes or 'Context' objects. I would suggest you make all classes package protected and let the user see only one class, the entry point. Ideally, this is how I should use your client:

final Jenkins jenkins = new RtJenkins("...apitoken");//"Rt" from "RESTful" or "Runtime"
jenkins.projects().search("my-project").build();

Where, of course, .projects() returns an instance of Projects which, among others, extends Iterable<Project>, so I could iterate all the Projects in jenkins like this:

for(final Project project : jenkins.projects()) {
    //do something with them.
}

The above is just my opinion, since I've developed quite a few wrappers in this encapsulated and fluent fashion and it seems to work just fine. For an example, see docker-java-api.

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

1 participant