Skip to content

Encapsulate everything #3

@amihaiemil

Description

@amihaiemil

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions