Skip to content

Proposal: Add a Feed type #6515

Open
@habrahamsson-skanetrafiken

Description

We are currently representing feed ids as String feedId and these strings are passed around and used to create FeedScopedIds. I propose to instead add a specific type Feed to use instead of using strings. This Feed will act as a factory for FeedScopedId. This would give us a bit of type safety and get better control of how FeedScopedIds are created.

See PR #6516 for an illustration of what this could look like.

Before:

void doSomething(String feedId, ...) {
  ...
  var id = new FeedScopedId(feedId, netexId);
  ...
}

After:

void doSomething(Feed feed, ...) {
  ...
  var id = feed.scopedId(netexId);
  ...
}

What do people think about this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ImprovementA functional improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions