Blog Articles on DDD, Event Sourcing and software development in general, with a sprinkle of PHP and sarcasm.

Introducing DDD to your Company

The following are my notes from the last DDD IE meetup, [6th June 2019](https://www.meetup.com/Domain-Driven-Design-Ireland/events/261668803/), on how to introduce DDD to your company. This post is about the concepts we discussed and discussions we had around the topic. There's some great stuff in here, the kind that can only happens through discussion and collaboration. First off, the meetup itself was structured as half talk, have group discussion, with discussion interspersed throughout the slides. We've done a few of these style of meetups in the past and they've worked out really well. Here are the slides: https://slides.com...
Read on »

Folder Structure and Frameworks: What is exerting control?

Recently I've been thinking about folder structures, specifically how we structure our web apps to encourage the design we want and to enable other developers to explore and understand the codebase. This train of thought was spurred by a problem we faced with one of our apps, which I'll go into shortly. ## Folders Give Context When we open up an application the folder structure is the first thing we see, even before we glance down at the readme. It conveys the hierarchy of concepts and hopefully how they relate to each other. A haphazard folder hurts more than it helps, especially if you have to hop around from folder to folder. Ch...
Read on »

Notes from Working Effectively with Legacy Code

Do you work with Legacy code? You probably do and don't realise it. IMO, if the code is over 5 years old, messy and it makes money, then it's probably legacy. Legacy code is tricky, and most of us try to avoid it, moving onto sexy new ideas and projects as time moves on. This means that we never learn to deal with legacy, and all the while, the codebase is chugging along, getting worse and increasingly expensive to change. If we don't learn to deal with legacy code, then we'll never learn how to maintain systems over time. We need to address this. That's where this article comes in, it is a collection of my notes from reading and a...
Read on »

Managing projectors is harder than you think

We've discussed the [bones of projectors in the past](/blog/projection-building-blocks-what-you-ll-need-to-build-projections), this time let's go deeper and look at how to manage them. At it's simplest a projector is something that takes in a stream of events and does some work on them, projecting them into whatever shape or operation is needed. Like anything though, there's more to it than that, lots more. That's what this article is, my attempt to discuss the complications and problems you will run into while working with projectors day to day. # Run modes Let's start simple, let's talk about the different modes of projectors a...
Read on »

Domain Driven Design for Everyone Else

I've been talking a lot about Domain Driven Design (DDD) lately, be it at meetups or with clients, so I thought I'd write down my thoughts and see if it helps. Now, lots of people have written about DDD from a technical perspective (see the end for links), so I'm not going to do that, instead I'm going to discuss DDD from a non-technical perspective. This is DDD for everyone else. ## Solutions Always Overrun Designing and building a solution is not a trivial problem. It never goes smoothly, and even if it's completed on time (which is never) the solution is usually ineffective and needs to be changed, often drastically. This lea...
Read on »

Communication styles - Working effectively as a team

This idea for this article came from a twitter thread by [@ErynnBrook](https://twitter.com/ErynnBrook/). The t...
Read on »

Acceptance testing your PHP app with ease

Acceptance tests are core to any stable system, they're how you make sure it actually works, start to finish (My preference is to write them first, use them a guideline to make sure the feature I'm writing works as expected). When writing acceptance tests, it's best to treat the system as a [blackbox](http://softwaretestingfundamentals.com/acceptance-testing/), inputs go in and outputs go out, that's it. This proves our app works and can be interacted with by other systems. Some frameworks come with this built in, like [Laravel](https://laravel.com/), but not every app is written in those frameworks, infact most are not (especially...
Read on »

Immediate vs eventual consistency

In the [last article](https://barryosull.com/blog/projection-building-blocks-what-you-ll-need-to-build-projections) we looked at projectors, the backbone of any CQRS/Event Driven system. This article was originally meant to be about implementing projectors, but I realised there was an important question to answer first, one that would shape the solution, "When do we project the events, now, or later?". Turns out this question has far reaching effects, so it's important we dig into it before moving onward. # Immediate vs Eventual Consistency When it comes to projectors there are two choices, immediate or eventual consistency. With i...
Read on »