Naming of your methods

by Apr 10, 2023

Good naming of your methods can solve a lot of customer issues.

I use NServiceBus as messaging framework in dotnet. I was using a method of this framework, which wasn’t doing what I was expected.

NServiceBus uses a UnitOfWork pattern when sending messages. I was using the method RequireImmediateDispatch(), This flags NServiceBus to dispatch messages immediate, instead of sending them at the end of the UnitOfWork.

Apparently, there is also a method to check if this flag is set. This method is called RequiredImmediateDispatch(). Did you see the problem?

I didn’t. It is only different by one letter.

I used the wrong one in my code and that resulted in strange behavior that I couldn’t explain.

In NServiceBus 8 this method is now renamed to IsImmediateDispatchSet() which hopfully prevents my mistake happing to other users.

Subscribe to
The Daily Friction

A daily newsletter on automation and eliminating friction

Related Content

Small, Daily Steps to Success!

Small, Daily Steps to Success! Success isn't birthed from grand, one-time events. It's the result of consistent, everyday actions. For instance, reading 10 pages daily trumps consuming a book in one go. This principle applies to fitness, relationships and business...

read more

Is Campaign still being used in Dynamics 365 Sales (CRM)?

Is Campaign still being used in Dynamics 365 Sales (CRM)? Campaign management has already been a long time in Dynamics 365 Sales, but is it still being used out in the wild? You can create a Campaign as a container for actions. You can add a Marketing List as a target...

read more

Think you need approval? Think again.

Think you need approval? Think again. In the fast-paced world of business, time is not just money; it’s everything. Yet, many processes are still handcuffed by the need for approvals. It's a common misconception that every decision needs a green light from someone...

read more
Share This