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

Unify namespaces in Kentico.Kontent.Delivery.Abstractions #303

Merged
merged 3 commits into from
Nov 24, 2021

Conversation

Simply007
Copy link
Contributor

@Simply007 Simply007 commented Nov 21, 2021

Motivation

Unify all namespaces in Kentico.Kontent.Delivery.Abstractions assembly to the same namespace.

Based on #300 (comment)

Related to #287

Checklist

  • Code follows coding conventions held in this repo
  • Automated tests have been added
  • Tests are passing
  • Docs have been updated (if applicable)
  • Temporary settings (e.g. variables used during development and testing) have been reverted to defaults

How to test

If manual testing is required, what are the steps?

@Simply007
Copy link
Contributor Author

@petrsvihlik - I have bad news - I have found one class - DeliveryOptionsExtensions - that used sub-namespace Kentico.Kontent.Delivery.Abstractions.Extensions.

I wanted to fix single namespace requirement and cover this rule in tests.

For now, I have fixed this, but I would like to hear your opinion on this first.

@petrsvihlik
Copy link
Contributor

Yeah, it makes sense to unify this one and have it covered by a unit test - a good idea btw.

Regarding the prevention of problems caused by referencing multiple versions of the same package (e.g. through nested dependencies). The only good solution is to be 100% backwards compatible with older versions of the same package. This requires extreme diligence when designing the APIs and ideally a very thorough review process.

Just for the sake of completeness - there is another way to prevent assembly conflicts and that's called strong-naming. I even wrote an article on that a couple of years ago. Even MSFT says that "Strong-names are leftover from previous eras of .NET" and acknowledges that "the majority of third-party assemblies do not need strong names". Even though, MSFT says that publicly published .NET libraries should be strong-named as not strong-naming a .NET library excludes anyone who does need to strong-name their application or library from using it. But even if you decide to start strong-naming the assemblies, you have no control over other publishers of libraries that depend on your library. You can't force them to reference strong-named assembly.
In other words, it might be a good idea to start signing the assemblies in case someone wants to use them in an application they have 100% control of. But it's not a solution to this problem in general.

@Simply007 Simply007 marked this pull request as ready for review November 23, 2021 15:26
@Simply007 Simply007 requested a review from a team November 23, 2021 15:26
@Simply007 Simply007 merged commit caa9ac3 into vNext Nov 24, 2021
@Simply007 Simply007 deleted the abstractions-fix branch November 24, 2021 14:51
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.

2 participants