-
Notifications
You must be signed in to change notification settings - Fork 132
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
Suggestions: Context Translation Middleware #1419
Comments
This is an interesting proposal. Someone in my firm raised this same issue to me last year e.g. whether there are standard mechanisms in FDC3 to handle this type of requirement. I've also had similar discussions more recently relating to translation not so much between two different standard identifiers, but between standard and internal/proprietary identifiers. Just to open up the just discussion a bit, here's a few thoughts I had when reading the above:
[1] Just to be more specific about one of the suggestions above on guardrails and changing the concept of the transform function to instead emit just the additional properties, what I was getting at was something along the lines of: Original context (pre-middleware execution): {
type: "fdc3.instrument",
id: {
cusip: "594918104"
}
} Additional properties (return value from enrichment function provided to middleware executor): {
id: {
isin: "US5949181045"
}
} Enriched Context (post-middleware execution): {
type: "fdc3.instrument",
id: {
cusip: "594918104",
isin: "US5949181045"
}
} But given that you could not prevent the enrichment function from returning an object also containing existing properties, the deep merge would have to ensure it only added new properties and did not update existing property values. On this basis, the enrichment function would effectively be free to return an extended context (containing both existing and new properties) which would likely be easier to author. But the key point is that the middleware handler would not simply use the value returned from the enrichment function as-is, it would apply this very specific (guarded) deep merge. Of course, there are downsides to the above approach - hence I think that if there was an intention to make the proposal support guardrails, a number of different approaches and patterns would need to be put on the table, evaluated, and discussed. |
Enhancement Request
Use Case:
Suppose there is an existing ecosystem of applications that communicate with each other via
DesktopAgent
. The context for thefdc3.instrument
type includes theid.ISIN
property. One day, a third-party application is to be integrated into the ecosystem and communicate with the existing applications viaDesktopAgent
.The problem is that this application doesn’t support
id.ISIN
but instead supportsid.FIGI
.Refactoring all existing applications to add
id.FIGI
to every context broadcast is expensive, so it would be helpful if the contexts could be converted automatically according to defined rules.Workflow Description
Context Translation Middleware: Middleware within DesktopAgent that automatically converts contexts based on defined rules (e.g., context type) during broadcasting.
Error Handling: If there are any cases where the translation is not feasible,
DesktopAgent
should handle this so developers can log the situation and alert the administrators. This ensures visibility for unsupported context translations and reduces potential issues during runtime.Workflow Examples
The text was updated successfully, but these errors were encountered: