This is Episode #5, where I continue fixing the violation of Command-Query Separation (discussed in Episode 4) in the Game Domain by introducing a new Query method.
We discuss a question from a viewer dealing with "breaking API changes".
We then introduce a place to save and load Game aggregates with the "GameStore" (which follows the Repository DDD tactical pattern, but use a different name to avoid confusion). We improve the "Nullables" factory creation methods in the Lobby class to make testing easier.
GameView is then reintroduced for showing the created games in the "Game Lobby" (main game page for choosing a game to join).
We then start adding a new endpoint for joining a game using its "handle" and are reminded the "Player" is a separate Aggregate from "Game", so only IDs should be used as parameters.
----
I'm developing the online version of JitterTed's TDD Game (see https://tdd.cards for the physical game) 100% live in front of viewers.
Tech Stack: Java with Spring Boot, Spring MVC and (eventually HTMX), JUnit testing via TDD, and architected according to Testable (Hexagonal) Architecture principles.
You can find the code on GitHub at: https://github.com/jitterted/tdd-game and look through the commits to see the progress made in the videos.
These videos are from my live coding that you can find on Twitch: https://JitterTed.Stream
You can discuss this on my Discord: https://ted.dev/discord, and find get in touch with me in various ways: https://ted.dev/about
Other episodes in this series: • JitterTed's TDD Game: Online Version