I was greatly influenced when I saw the video in YouTube about Alistair's hexagonal architecture. Big shout out to Alistair Cockburn for beautifully explaining the port and adapter's pattern (a.k.a hexagonal architecture). I loved it just because of its separation of concerns which enables high scalability and helping me introduce the plug and play concept. I wanted to try out the same KATA as Thomas PIERRAIN (again impressed with TDD and being bullet proof) while watching the video but with Java.
- Write the left side port for test for requesting poetry i.e.
RequestVerse
. - Write the domain i.e.
PoetryReader
which can be hardcoded. This very first version of the business logic returns an hard-coded result.
- Write the right side port
ObtainPoem
with adapters i.e. test which fetches the poem using stubs.
- Write a
ConsoleAdapter
(left side) which could write to the console (default) as the default publication strategy.
- Write a
Console
application for the end user.
- Write a
PoemFileAdapter
(right side adapter) that will return the content by reading the file.