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

Scrum conceals bad teams.

Scrum conceals bad teams. Far too often, we confuse Scrum with a magic wand that transforms any team into a high-performing 'dream team'. It's tempting to believe that the sprint system, with its regular completion and initiation of tasks, gives us an agile and...

read more

🚀 Process Automations in Microsoft Loop!

🚀 Process Automations in Microsoft Loop! Now you can create Power Automate-backed rules to streamline repetitive tasks in your Loop table. See Loop is slowly...

read more

You don’t control the truth in Production!

You don't control the truth in Production! Now a days multiple teams/projects are working on the same Dataverse production environment. So thinking you can manage the complete production truth in your ALM pipeline is strange. Not every environment is 💯 equal to...

read more
Share This