NServiceBus/NServiceBus — pull request #845 by SimonCropp (2012-12-27 12:45:04+00:00)
Title: Modules: A proposal for NServiceBus 5

So I performed a little spike on develop. This is not meant to be working code nor a real pull request. Just enough to illustrate an idea

I am experimenting with the idea of splitting NSBinto modules.

As an example I broke out the logging into assemblies

NServiceBus.Logging.NLog.dll
NServiceBus.Logging.Log4Net.dll
NServiceBus.Logging.CommonLogging.dll (yes i added this one)

Then at startup NSB can scan for an assembly starting with "NServiceBus.Logging." and use that for logging.

The gut of the approach is here https://github.com/SimonCropp/NServiceBus/blob/modules/src/NServiceBus.Core/Logging/LogManager.cs
It is heavily convention based

The same approach could be taken for "NServiceBus.Persistence", "NServiceBus.Transport", "NServiceBus.Serialization" etc.

Each of these modules could then be deployed as a nuget package.

Benefits

* much fewer dependencies on third party libraries
* modules can evolve and change with less impact on the NSB core
* multiple versions of the same module could exist to target different versions of third party libraries
* smaller footprint because there will be less things to ILMerge

Drawbacks

* NSB comes broken OOTB. Without the appropriate nuget packages NSB would be effectively broken. ie it would throw an exception. This can be mitigated by a few things

Throwing useful exceptions
Doco
A default nuget. This would be a nuget package that depends on all the recommended "default" modules.

* Significant breaking change in how NSB works

Any other drawbacks??

Overall thoughts??