background preloader

Conception / Architecture

Facebook Twitter

What TDD Is and Is Not. In my travels, I’ve heard a lot of people embrace test driven development (TDD) and I’ve heard a lot of people say that it isn’t for them. For the most part, it’s been my experience that people who say it isn’t for them have either never really, actually done it or haven’t done it enough to be good at it. Lest you think I’m just being judgmental, here’s a post of mine from about 3 years ago, before I had truly taken the humbling plunge of forcing myself to follow the red-green-refactor discipline to the letter. My language here is typical of someone who buys into unit testing and even to TDD, but who hasn’t become facile enough with the process to avoid feeling the need to tinker with it and qualify the work. If you cut to the heart of what’s going on in my post there (and I say this hat in hand) it’s less “here’s my own special way of doing TDD that I think is actually superior” and more “I haven’t yet gotten good enough at TDD to use it everywhere and that’s rather frustrating.”

DDD Sample Application - Architecture. Architecture The sample application is layered as illustrated by this picture: There are three vertical layers: Interfaces, Application and Domain, each supported by different kinds of infrastructure. Interfaces This layer holds everything that interacts with other systems, such as web services, RMI interfaces or web applications, and batch processing frontends. Application The application layer is responsible for driving the workflow of the application, matching the use cases at hand. The application layer is thin in terms of domain logic - it merely coordinates the domain layer objects to perform the actual work. Domain The domain layer is the heart of the software, and this is where the interesting stuff happens. The core of the business logic, such as determining whether a handling event should be registered and how the delivery of a cargo is affected by handling, belongs in here.

Infrastructure In addition to the three vertical layers, there is also the infrastructure.