Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NServiceBus - what is the point of IHandleMessages<T> vs IMessageHandler<T>?

What is the point of IHandleMessages<T> vs IMessageHandler<T> in NServiceBus 2.0?

One interface derives from the other and does not appear to add any new methods or new constraints on T. It is possible that one is a marker interface but there is no evidence for this in the comments.

like image 752
Thomas Bratt Avatar asked Jan 26 '10 09:01

Thomas Bratt


1 Answers

The reason is that it follows the newer naming convention for interfaces in NServiceBus, where the name states explicitly what it does: IHandleMessages, IPersistSagas, IContainSagaData, etc. The letter 'i' at the beginning is the interface speaking of itself.

When taken together, these result in more readable code bases, if only slightly, but bring the language of the framework closer to that of the developer, thus decreasing the learning curve and friction of usage.

like image 143
Udi Dahan Avatar answered Nov 13 '22 14:11

Udi Dahan