Replies: 7 comments 9 replies
-
cc @eerhardt feedback for our API cleanup. |
Beta Was this translation helpful? Give feedback.
-
@The3G - do you have some concrete examples? |
Beta Was this translation helpful? Give feedback.
-
@eerhardt just one area are the event objects, they have a mixture property names for the IServiceProvider 'Services' and 'ServiceProvider' It would be good IMHO if a event base class was used to hold common properties like IServiceProvider; and thus providing a consistent common interface or extending the IDistributedApplicationResourceEvent interface, better yet have a generic of DistributedApplicationResourceEvent that implements the IDistributedApplicationResourceEvent with the IServiceProvider as a property. I've also seen this mixture of public property naming within the Annontations and Callbacks thus far. |
Beta Was this translation helpful? Give feedback.
-
The reason IDistributedApplicationResourceEvent doesn't expose IServiceProvider as a property is because sometimes events can fire before the service provider exists. That's why it is up to each individual event to expose it if it has access to it when it is typically fired. That said most events should expose it and if the property name is not consistent we should address that. We could define another interface to test for whether an event exposes the service provider but I'd be interested in the scenario that requires it since when you subscribe to events you do it for each event type. |
Beta Was this translation helpful? Give feedback.
-
@mitchdenny Thanks for your response; I understand that dependent on when the event is fired that the IServiceProvider may be not availible; I would however thought that a IServiceProvider property still exist with either a null or empty IServiceProvider. If the IDistributedApplicationResourceEvent was to updated with a IServiceProvider? [propertyName] (the chosen consistant name) or a new interface of IDistributedApplicationResourceEventWithServiceProvider (for example) with the IServiceProvider? property, together with a helper that checks the event support the IServiceProvider and has a value present this would help for the follow. the creation a single function/callback that handles all/any current events or any new events that we may need to created to support different use cases and/or events from different runtime/deployment platforms. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Did a scan:
We have some things with ServiceProvider and others with Services |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
There are a number of sealed classes that represent the context; these are passed to developers code via a annotation callback function; both the callback func of the annotation and context passed are inconsistent and differ between each implementation.
The context naming of the IServiceProperty accessor flips between ServiceProvider or Services; with the callback having no constraint or defined common/generic pattern; some passing.
It would be I feel good to have some consistency and or have a minimum requirment enforced by an interface/generic on the callback func and the context these contracts would ease the development and implementation of annotations and allow for code reuse.
Beta Was this translation helpful? Give feedback.
All reactions