dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.

Home Page:https://asp.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistent namespaces

PonchoPowers opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

This happens in quite a few places, some namespaces have the word Abstractions in them, but then others don't.

Microsoft.Extensions.Caching.Abstractions
Contains classes with the namespace:
Microsoft.Extensions.Caching.X (no Abstractions in namespace)

Microsoft.Extensions.Configuration.Abstractions
Contains classes with the namespace:
Microsoft.Extensions.Configuration.X (no Abstractions in namespace)

Microsoft.Extensions.Logging.Abstractions
Contains classes with the namespace:
Microsoft.Extensions.Logging.Abstractions

Microsoft.Extensions.FileSystemGlobbing.Abstractions
Contains classes with the namespace:
Microsoft.Extensions.Logging.Abstractions

I think there are 8 namespaces that include the word Abstractions in them.

Is there a reason for this, and if not, is it correct to include the word Abstractions or not?

Also, if Abstractions should be included, where should the positioning of the word be, at the end of the namespace, or at the end of the project name, ie:

Microsoft.Extensions.Logging.AnotherProvider.Abstractions
- or -
Microsoft.Extensions.Logging.Abstractions.AnotherProvider

Can you provide some guidance on this please?

Expected Behavior

My personal view is that abstractions should have namespaces with either the word Abstractions in them or not.

I also think either an analyzer rule should be created to avoid this from happening or have some other way to protect against inconsistent namespace rules.