Skip to content

Standardise API for Tracker and Subject Builders #302

@mscwilson

Description

The Builder pattern is used extensively in the Java tracker. However, two different styles are implemented. For example:

Style 1:

Tracker tracker = new Tracker.TrackerBuilder(emitter, namespace, appId).build();

There is a TrackerBuilder nested class.

Style 2:

BatchEmitter emitter = BatchEmitter.builder().url(collectorEndpoint).build();

There are Builder and Builder2 nested classes.

Tracker and Subject use Style 1. Emitters and Events (PageView, etc) use Style 2. This isn't great for usability.
Style 2 code is also quite hard to follow. It would be helpful to standardise all the public API classes to use Style 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood issue for a first time contributor.priority:lowNot on the roadmap.status:completedCompleted - but might not be released yet.type:enhancementNew features or improvements to existing features.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions