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

Proof of concept of adding a Feed type #6516

Draft
wants to merge 1 commit into
base: dev-2.x
Choose a base branch
from

Conversation

habrahamsson-skanetrafiken
Copy link
Contributor

Summary

This is a proof-of-concept of how #6515 could be implemented. It is not a complete solution and won't compile. It's just meant to illustrate the proposal.

@t2gran
Copy link
Member

t2gran commented Mar 13, 2025

A Feed i OTP is set of consistent data. In this PR thare is a Feed that is only about creating IDs. This is probably a FeedScopedIdFactory.

So, I suggest the following:

interface OtpIdFactory {
  FeedScopedID createId(String entityId);
}

class FeedScopedIdFactory  implement OtpIdFactory {
  FeedScopedID createId(String entityId);
}

The createId(..) retuns FeedScopedID for now - since it is the only ID we support, but we can shange this in the future to OtpId and lett FeedScopedID and NetexIdinherit from these. This will support mixing GTFS and Netex feeds without the hack we do to adjust the NetexIds today.

Future improvements
This is not directly handled by this PR, by we should move toward this goal.

The usecase we should aim to support is:

A Feed may have a IDFactory creating IDs specific to the feed (GTFS or Netex). Serializing ID in the API is simple, but input ids need a form of strategy to determin witch Feed it matches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants