Skip to content

Conversation

@twsouthwick
Copy link
Member

@twsouthwick twsouthwick commented Oct 25, 2022

With the current layering, the FrameworkServices and CoreServices libraries have some shared source. This is fine for internal implementations, but for public types, this causes two types to exist with the same name but different assemblies. This is not an issue in the main case (i.e. in an application) as they will never depend on each other.

However, the problem arises when a user wants to develop an implementation on a shared, public service that would then be consumed by both the framework services and core services. An example is the ISessionKeySerializer, that a user may want to customize for themselves, but the framework and core services have identical interfaces, but in different assemblies. These are logically the same service, and should therefore have the same identity (i.e. same assembly).

With the current layering, the FrameworkServices and CoreServices libraries have some shared source. This is fine for internal implementations, but for public types, this causes two types to exist. This is not an issue in the main case (i.e. in an application) as they will never depend on each other.

However, the problem arises when a user wants to develop an implementation on a shared, public service that would then be consumed by both the framework services and core services. An example is the ISessionKeySerializer, that a user may want to customize for themselves, but the framework and core services have identical interfaces, but in different assemblies. These are logically the same service, and should therefore have the same identity (i.e. same assembly).
@twsouthwick twsouthwick force-pushed the tasou/create-services-package branch from e864c4f to f6ba6ab Compare October 25, 2022 18:43
Copy link
Member

@mjrousos mjrousos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except that I'm not entirely sold on the name. A couple other comments inline.

@Tratcher Tratcher self-requested a review October 26, 2022 20:41
@twsouthwick
Copy link
Member Author

Based on feedback, I've updated the package to be Microsoft.AspNetCore.SystemWebAdapters.Abstractions and only contain the public types that need to be shared. Turns out that the namespaces for the extension methods are not actually shared (i.e. System.Web vs Microsoft.Extensions.DependencyInjection), so those are still in the shared services.

This also allows the abstractions to be .NET Standard 2.0 so libraries that extend the types should be even simpler to produce.

@twsouthwick twsouthwick merged commit 83368e1 into main Oct 28, 2022
@twsouthwick twsouthwick deleted the tasou/create-services-package branch October 28, 2022 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants