The benefits of over-communicating
Recently I've given an internal presentation about so-called over-communication. What's that? It's a methodology (spirit, philosophy, doctrine...) that tries to help you with one of the ancient problems in IT - lack of communication. (Hold on, is it a problem, really? - you may think right now. The answer is...
How rubyists invert control?
Well, like this: # File sandwich from Ruby Koans def file_sandwich(file_name) file = open(file_name) yield(file) ensure file.close if file end file_sandwich('file.txt') do |file| puts file.count end …and like that: // Composition of React components function Layout(props) { return ( <Grid> <...
Builder pattern in Node.js
In this post, I'm going to explain the builder pattern in Node.js. I'll use the code constructed in my previous posts - see the repo. Because the changes are not compatible with the previous version, they are committed to builder-pattern branch Builder is useful whenever you need to build...
Adapter pattern in Node.js
In my previous posts I explained the idea of Service Objects, and how to test them. I also prepared the repository with the working code on GitHub - check it out if you feel like it. The code contains also another fascinating design pattern - adapter for Facebook API. Let's...
Testing service objects in Node.js (Mocha)
Testing service objects in Node.js (Mocha) Let’s continue our journey with service objects in Node.js. If you haven’t read a first part, here you have a change. Today we will show how to test them. But first of all - let me start with how to...
Service objects in Node.js
In MVC frameworks it’s usual that controllers contain a lot of code and are the hardest part to understand; in consequence - to debug and refactor. Why? One of the answers would be: controllers don’t respect Single Responsibility Principle. Their job starts when they receive an HTTP request,...