Loïc Faugeron has continued his "Mars Rover" series in his latest post today. This series, based on a set of specifications from a development challenge. In this latest post he continues looking at event sourcing and creates a package to handle the eventing to make it more flexible and robust.
In this series we're building the software of a Mars Rover, according to the following specifications. It will allow us to practice the followings: Monolithic Repositories (MonoRepo), Command / Query Responsibility Segregation (CQRS), Event Sourcing (ES) Test Driven Development (TDD).Up until now, we've implemented the first use case, "Landing a rover on Mars" [and] in the last article, we wrote some Event Sourcing code. [...] In this article, we're going to extract them from the navigation package and put them in their own event-sourcing package.
He starts by creating the package itself as a Composer package including the composer.json
configuration and a few other files to have phpspec work correctly. He then adds the event-sourcing
package to the main project and starts in on using phpspec to generate its basic files. He then updates the main Lander class to use this new package for events. There's no code in the eventing classes yet, but stay tuned for the next tutorial in the series that will update them and get it all working together.