Date archives "April 2016"

A word about immutability

Immutability is a quite old concept that is mostly related to the functional programming, however, it’s also (maybe not so widely) used in the object oriented programming.
An immutable variable/object can not be mutated, which means that once it’s been initialized it will never change it’s original value/reference (unless it’s deallocated).
This approach results in some great benefits such as out of the box thread safety, yet in the OOP world, it does seem to be quite often abused or even not used at all. When should we make use of the immutability? Are there some variations of this approach? How to make immutable objects in C#? Let’s find out.

Continue reading

Sentry – the MongoDB watcher

If you’re looking for a simple service for monitoring your MongoDB (things like opening a connection to the database or executing a query and processing the results), then you might find interesting a new type of the watcher added to the Sentry. The MongoDB watcher uses the C# MongoDB Driver under the hood but it’s been implemented in a way, that it’s possible to provide any driver that you’d like.
In this post I’ll present how to use it and why it’s been implemented this way instead of another one.
Continue reading