jboss-set / aphrodite

A java api for retrieving and updating SET issues from multiple issue trackers.
4 stars 26 forks source link

Expose a more fine-grained API #70

Open ryanemerson opened 8 years ago

ryanemerson commented 8 years ago

Currently all Aphrodite methods are exposed by an Aphrodite instance, this is simple for the user, however this has resulted in Aphrodite.java becoming increasingly bloated.

It could be advantageous to split Aphrodite's interface into multiple sub-managers. For example we could have:

Aphrodite aphrodite = Aphrodite.instance()
IssueTrackerManager isManager = aphrodite.getIssueTrackerManager();
isManager.searchIssues(...);

RepositoryManager repoManager = aphrodite.getRepositoryManager();
repoManager.getPatchesAssociatedWith(...);

...
// Apply to Stream Services as well

Utilising Manager classes in this way, would also allow additional features to be added without further polluting Aphrodite.java. For example, each individual 'Manager' class could expose additional options, such as getIssueTrackerByHost() etc which would allow applications to utilise individual instances of IssueTrackers directly.

elguardian commented 8 years ago

I think is better to keep calls like getIssueTrackerByHost() in aphrodite and return some sort of CompositeIssueTrackerService (implementing the IssueTrackerService) than creating a new class like a manager. This way we are always working with the service interfaces.