Category Archives: Development

DDD, SAGA Pattern, and Outbox Pattern with Real Code – Part 1

Intro DDD (Domain-Driven Design) is a fairly popular approach that, while facing some criticism, has benefits that are evident for complex projects. Reading theory is one thing, but diving into code implementation is entirely different – it provides hands-on experience and a deeper understanding. Practice is practice. We’ll start with the theory of DDD and refer back to… Read More »

DDD domain objects, entities and anemic model

Intro An anemic domain model happens when your domain model is mostly focused on storing data and has very little business logic or behavior. This can occur when the design of your database heavily influences how you structure your code. Instead of creating a model that reflects the actual business rules and logic, you end up with simple… Read More »

C# .NET timers and multithreading

This is an old note about timers in .NET that might be interesting to someone. I believe the same concept could be applied in other programming languages. As noted by Joe Albahari in his article about timers (http://www.albahari.com/threading/part3.aspx#_Timers), they provide a more effective way to manage memory and resources compared to an approach where we create a thread… Read More »

Refactor legacy C++ code for testing / working with private and protected methods

C++ has acquired capabilities related to inheritance throughout its rich history that are not available in high-level languages like C# or Java (although simplified design avoids issues like the diamond problem; however, the diamond problem can still occur with interfaces in Java. But our topic today is testing, not language design). These capabilities include multiple inheritance, public/protected/private inheritance… Read More »

Use C++ unit tests on MacOS

I’ve never written C/C++ code for macOS before, despite using macOS as my primary notebook for daily tasks. It was fascinating to explore how configuration options for header files and libraries work in this environment. As you may recall, in Visual Studio on Windows, you can use various tools to build projects, including the very powerful vcpkg. On… Read More »

C++ vcppkg: A First Look

When you create your application using C/C++, there are several options for working with external dependencies, such as libraries like: and so on. Some of the libraries, along with header files, are available for installation using a Linux package manager thus we typically do the following: In Linux package managers, development-related libraries often have -dev or -devel as… Read More »

Dynamic-size arrays with ANYSIZE_ARRAY in Windows API

You can often find structure in the code that looks like this TOKEN_PRIVILEGES structure. The ANYSIZE_ARRAY macro is used in the definition of the TOKEN_PRIVILEGES structure to allow for a flexible array member. This is a common technique in C and C++ to define structures that can have a variable-length array as their last member. In C and… Read More »