Factory pattern is another prevalent pattern that we need to know. The main principle about the factory is that it separates the creation from use. But what does this means? We design a factory entity that creates the objects we want depending on what we want. We do not use the constructors directly on the
Category: coding
SOLID Principles in modern C++
When talking about patterns, one acronym seems to be the most popular, the SOLID principles. Yes, actually SOLID is an acronym that stands for: Single Responsibility, Open-closed, Liskov substitution, Interface Segregation and Dependency Inversion Too many strange terms, a little bit dry. I can think of two things that will help us go through. The
Observer Pattern in modern C++
We have started a series of posts trying to present ridiculous popular design patterns using examples in modern C++. Again, the inspiration came from the great youtube video series, ArjanCodes. This time we are going to talk about the observer pattern which is going to help us separate various modules in our code. The key
GitHub Actions and Conan
It’s always wise to use continuous integration (CI), even in our hobby projects. When working with C++, it might be painful to install the required dependencies, even for the most essential packages like the googletest for the unit tests or the spdlog for the logger. In those cases, using Conan package manager is a no
Dependency Inversion Pattern in modern C++
Dependency inversion is one more pattern that is going to help us improve abstraction. We mean that by applying this approach, we separate the definition of an interface from the actual implementation. To explain the pattern, there is a classic example with the light bulb and the switch. If we assume that we want to
Strategy Pattern in modern C++
In this post, I’m going to talk about the strategy pattern. As I have mentioned in a previous post, my initial inspiration started as I watched ArjanCodes youtube video tutorials. In of those (link), he began to explain the strategy pattern. This approach comes in handy when we build a structure, and we could have
[Part II] IoT with docker-compose
Perfect is the enemy of good. That’s the case with the IoT backend system that we described part I. In our previous post, we went step by step through the procedure of setting up: MQTT server to listen in incoming topics, e.g. sensors, Influx database to store time series of sensor data, Telegraf to connect
[Part I] IoT with docker
To use the correct tools to implement a task is so important. When playing with IoT applications, you will inevitably touch: MQTT, for handling easily the messaging, InfluxDB database, to store the data in a timestamped fashion (time-series arrays), and Grafana, to visualise the data This is good, but do you mean that I need
TDD, GoogleTest, GitHub, Travis CI and Conan; the easy way!
Test-Driven Development (TDD) is a popular approach in developing code bases and there is a good reason for that. There are many books that explain the way and the advantages of adopting an approach like that. In today’s post, I’m not going to explain that again. An amazing book that I can suggest is the
Continue reading TDD, GoogleTest, GitHub, Travis CI and Conan; the easy way!
How to install Armadillo library, the easy way!
Back to May, we have written a post about the procedure we need to follow in case we want to use the Armadillo library in Ubuntu. It works, but in this post, I would suggest an even easier way to do it. The solution called Conan, the C/C++ Package Manager. It can be used for
Continue reading How to install Armadillo library, the easy way!