Loïc Faugeron has posted the latest tutorial in his series about developing a "Mars Rover" script using various design patterns and principles. In this latest part of the series he looks at handling the "landing event" of the rover.
In this series we're going to build the software of a Mars Rover, according to the following specifications. [...] Previously we've created a navigation package, and in it a LandRover class that validates input parameters for our first use case. [...] We've then refactored it to extract coordinates and orientation in their own classes.In this article we're going to create the actual landing logic, using Event Sourcing
He then starts in, creating the tests first because of TDD, on the LandRoverHandler
to integrate a command architecture (using the Command Bus pattern). He then sets up the structure for the event sourcing and an basic event for the landing of the rover. This includes the handler for the event, the event itself and the storage method for capturing that the event happened. He fills in the generated classes with a bit of logic and a few updates to the test for the new structure.