Latest news and articles about DDD, CQRS, Event Sourcing and Software Architecture in general, aggregated daily and delivered weekly to your feed (RSS) reader. Subscribe here!

Week 52, year 2014

  • Don't use Ids in your domain entities! - How often do you see code like this in your domain model? public void Ship(int orderId, int customerId, string address) { Shipment shipment = _existingShipments.Single(x => x.OrderId == orderId); if (shipment.CustomerId == customerId) { // Do something } } Seems pretty good, doesn’t it? Well, it doesn’t. I’ve already pointed using Ids in domain entities as a bad practice, but I see developers - even sophisticated ones - write such code over and over again, so this topic definitely deserves a separate article. [Enterprise Craftsmanship]
  • How Much Testing is Too Much? - Figuring out how much unit tests you need to write, can be tricky, especially if you are new to Test-Driven Development. Some teams strive for 100% code coverage. Some open source projects even announce their test coverage on their GitHub profiles – as if coverage is an indicator of quality. Coverage only measures the lines of code that are executed by the test suite. It doesn’t tell you whether the outcome of the execution is actually tested, let alone how valuable that test is. Because of that, code coverage of your entire code base is a pretty lousy metric. [Mathias Verraes]
Permalink | From 22 December 2014 to 28 December 2014 | Last updated on: Mon, 7 Jun 2021 09:18:52 GMT