A few weeks ago, we had a question at work: is it OK to create new Aggregates and modify existing ones in a single transaction? We’re using DDD principles for modelling and one of the rules of thumb regarding Aggregates is that you should not modify two aggregates in a single transaction. In our use … More Creating new Aggregates in DDD
Recently, we had a presentation at my workplace about Domain-Driven Design concepts, given by my team member. He tried to explain the main thoughts behind it and gave some real world examples to make it easier for the spectators to grasp them. After the presentation, I’ve noticed some confusion among the audience about actual usage … More Does DDD promote large Aggregates?
One thing that recently occupies my mind is how people tend to over-engineer their code to do things “the right way”. Development is a very creative process, involving countless hours of thinking, discussing and trying out different approaches to achieve the same thing – working software. There’s probably no two developers that would agree on … More The “best practices” and Return On Investment
Consider the following test code that is using Moq: Not going too much into details, what this method does is verify that _logRepository.LogRequest was never called. The tests that were using this check were always green, but after some time, we found out that there actually are entries in the logs that were supposed not … More Moq, argument matching and Times.Never
Nowadays, I’m working with WPF using MVVM pattern. To manage NHibernate session in viewmodels, I’m using the approach shown by Ayende, where session is a property of viewmodel. The problem is simple – sessions need to be disposed of and replaced after they throw an exception. That means we cannot use constructors to inject sessions … More Autofac OnActivated for all registrations
Recently I was writing my first Single-page application using Angular.js. The application should allow posting content as an anonymous user, so some sort of verification needs to be in place to make sure it’s actually a human user. For years, reCAPTCHA has been probably the most popular way to achieve that, so I went and … More Using reCAPTCHA in Single-page applications
Many of the systems I have been working on required sending email messages as part of certain use cases: email address confirmation, notifications, system monitoring reports, etc. When working for a company, I usually use their SMTP server to send testing emails when running in the development environment. But for my own projects, that’s not … More Testing email functionality in development environment