Skip to content

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.

@habrahamsson-skanetrafiken habrahamsson-skanetrafiken added the +Skip Changelog This is not a relevant change for a product owner since last release. label Mar 6, 2025
@habrahamsson-skanetrafiken habrahamsson-skanetrafiken requested a review from a team as a code owner March 6, 2025 14:44
@habrahamsson-skanetrafiken habrahamsson-skanetrafiken marked this pull request as draft March 6, 2025 14:44
@t2gran t2gran added this to the 2.8 (next release) milestone Mar 12, 2025
@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.

@t2gran t2gran modified the milestones: 2.8, 2.9 (next release) Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

+Skip Changelog This is not a relevant change for a product owner since last release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants