Building WordRepository and GameRepository Adapters
Learn about database design, accessing the database, and GameRepository implementation.
In this lesson, we’ll use the popular database library Jdbi to implement the fetchWordByNumber()
method of interface WordRepository
and make our failing integration test pass.
An external system, like a database, is accessed through a port in the domain model. The code that is specific to that external system is contained in an adapter. Our failing test enables us to write the database access code to fetch a word to guess.
Database design
A little bit of database design thinking needs to be done before we begin writing code. For the task at hand, it’s enough to note that we’ll store all available words ...
Get hands-on with 1400+ tech skills courses.