Archive of September 2016

There is a great principle in object-oriented programming which says: "Tell, Don't Ask".

This principle tells that we should not ask object about their state, make decision and only then tell them what to do. Rather we should send commands.

There is a good quote about that:

Today's post will be more about Ruby On Rails and ActiveRecord. But first things first. If you didn't hear about Law of Demeter, I really recommend to read about it.

In general - it's a set of rules which bounds knowledge of modules about each other and allows you to reduce coupling of your system.

Here is how Wikipedia describes it: