NHibernate.Caches.Redis
NHibernate.Caches.Redis copied to clipboard
Upgraded to NH5. Support for async.
The upgraded nuspec has not been tested. The sample web project didn't start here, but it's a bit dated.
Hi @gliljas,
Thanks for your work on this! I'm interested in merging this but there a few issues that would need to be addressed before I can do so:
- We must be able to support those that still depend on NHibernate < 5. Because NHibernate is such a fundamental library to applications, upgrading to NHibernate 5 isn't the easiest for everyone (I know this from personal experience). This means that the minimum version of which our Nuget package depends upon shouldn't have to change. I noticed in your nuspec changes that if targeting
net461
, use NHibernate >= 5.0. This makes sense from NHibernate 5 requiring .NET 4.6.1, but we need to make sure if someone is on .NET 4.6.1 that they can still use NHibernate < 5 (it's not immediately clear if this will work with Nuget). We need to make sure there is binary compatibility for NHibernate < 5. For example, if someone has version3.0.0-beta5
of this library installed, would upgrading to the next version force NHibernate to also be upgraded (obviously if our Nuget dependency changed it would force it)? - Some of the code doesn't match the existing code style (e.g. we only use spaces, extra whitespace lines, I don't like the idea of having a separate file for async, etc).
- There's a lot of superfluous changes to config files that aren't relevant to the NH 5 upgrade (e.g. what is
AsyncGenerator.yml
, why so manyApp.config
changes, etc).
Thanks for replying. I will give it a bit of cleanup and an attempt to support NH<5 cleanly.
How would you like to handle the backwards compatibility? A separate Async package with >=5 dependency and changing the dependency of the standard package to <5?
Can we not do it in one package using binary compatibility?
I don't see how, or am I missing something? Or are you thinking of having a package version 5 (or 4) with a NH5 dependency, while still being able to maintain v3 packages for NH4?
The "standard" caches were just upgraded
https://www.nuget.org/packages/NHibernate.Caches.SysCache/5.1.0
..and they've chosen to just up the dependency. I suggest the same for this library.
NH 5 isn't binary compatible with previous versions.
People needing to use older NHibernate should just use the previous cache package version. NuGet allows this.
The drawback is for supplying new features to them along to the latest version: it will require to publish a new version of the old package along with a new version of the up-to-date package. As long as the up-to-date package has a major version greater than the packages targeting previous NHibernate, it is doable without confusion by just upgrading the minor part of the version of both.