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

Try to work out a way of only avoiding duplication #12

Closed
jskeet opened this issue Jun 29, 2020 · 1 comment
Closed

Try to work out a way of only avoiding duplication #12

jskeet opened this issue Jun 29, 2020 · 1 comment
Assignees
Labels
api: eventarc Issues related to the googleapis/google-cloudevents-dotnet API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@jskeet
Copy link
Collaborator

jskeet commented Jun 29, 2020

With our current approach, we have duplication between serialization packages - both Google.Events.Protobuf and Google.Events.SystemTextJson include a "StorageEventData" type. This is to avoid forcing users to have a dependency on any particular serialization framework - both to avoid conflicts, and to allow functions etc to have minimal dependencies. The downside is that it adds a choice (which package to use) and could make it hard for libraries to be written that would like to be serialization-framework-agnostic.

Ideal requirements (noting that the Functions Framework can change - we don't have to worry about compatibility with the current alpha):

  • Not too closely tied to Google - it should be easy to consume CloudEvents that aren't from Google. (This may mean we need a "converter registration" mechanism in addition to "find the annotation on the data type")
  • Avoid dependencies as far as possible
  • Portability across serializers: ideally there'd be a single "serializer-agnostic" representation of each event type, and then conversion uses whichever serializer the user has plugged in

One potentially-inefficient option: if we had a serializer-agnostic representation in Google.Events, but then serialized "via" an internal class per serializer, that could work. The conversion between serializer-specific type and agnostic type could get hairy, and there are interesting versioning concerns... but it's a possibility.

@jskeet jskeet self-assigned this Jun 29, 2020
@product-auto-label product-auto-label bot added the api: events Issues related to the googleapis/google-cloudevents-dotnet API. label Jul 15, 2020
@product-auto-label product-auto-label bot added api: eventarc Issues related to the googleapis/google-cloudevents-dotnet API. and removed api: events Issues related to the googleapis/google-cloudevents-dotnet API. labels Sep 22, 2020
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Jan 29, 2021
@engelke engelke added priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Feb 8, 2021
@yoshi-automation yoshi-automation removed the 🚨 This issue needs some love. label Feb 8, 2021
@jskeet
Copy link
Collaborator Author

jskeet commented Aug 31, 2021

Closing this, as we haven't had any feedback that using protobuf is a problem.

There's no direct dependency from the Functions Framework onto any code in this repo now - the CloudEvents SDK has an attribute which allows an appropriate event formatter to be used, so that's not an issue. If we wanted a System.Text.Json version of the events, there'd still be duplication though.

@jskeet jskeet closed this as completed Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: eventarc Issues related to the googleapis/google-cloudevents-dotnet API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants