• Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    C#
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple kata to live-code with Alistair about Hexagonal Architecture

hexagonalThis

A simple kata to live-code with Alistair about Hexagonal Architecture

Steps (carpaccio style)

Alistair wants an application that provides poetry.

Steps:

  1. Test-drive the design of our 1st port (i.e. the intention, represented in C# with an interface: IRequestVerses and a first method: GiveMeSomePoetry()).

    • This very first version of the business logic (i.e.: the PoetryReader type) returns an hard-coded result.
    • The left-side adapter is both the unit test framework and the test calling the port
  2. Write another acceptance test with the simplest possible right-side adapter: a stub for the new right-side port: IObtainPoems and its unique GetAPoem() method/verb.

  3. Write another acceptance test to test-drive the usage of a new Console (app) adapter

    • Here, we need to mock the Console.WriteLine calls by introducing a ICanWriteLines strategy. This mock will assert that it has received the proper call after GiveMeSomePoetry is called.
    • Proper time to illustrate the 3 steps initialization of the Hexagonal Architecture (i. Instantiate the "I need to go out" ports and adapters ii. Instantiate the PoetryReader hexagon iii. Instantiate the "I need to go in" ports and adapter)
    • Introduce here an "hexagon" wrapper onto the business logic (to explicit the architectural pattern for the years to come?)
  4. Write a CONSOLE application (embedding the right-side mock) to get end-users feedbacks about the way we will soon ask questions to the system

    • Alistair's feedback (playing the end-user) is that we need to have other poems than the hard-coded one.
  5. Test drive a right-side PoemFileAdapter that will return the content of a file knowing its path (file being: Rimbaud.txt).

The application is now structurally complete (with left and right-side adapters). We can either:

- Add a CycleThroughPoemsAdapter (that will leverage on the Poetry.json file)
- Test drive a __JSON (left-side) adapter and create a Web API project to gather end-users feedbacks
- Replace the PoemFileAdapter and CycleThroughPoemsAdapter with a DatabaseAdapter
- Introduce a new API/Verb for the 1st port: GiveMeLines(int linesCount)

More Repositories

1

NFluent

Smooth your .NET TDD experience with NFluent! NFluent is an ergonomic assertion library which aims to fluent your .NET TDD experience (based on simple Check.That() assertion statements). NFluent aims your tests to be fluent to write (with a super-duper-happy 'dot' auto-completion experience), fluent to read (i.e. as close as possible to plain English expression), but also fluent to troubleshoot, in a less-error-prone way comparing to the classical .NET test frameworks. NFluent is also directly inspired by the awesome Java FEST Fluent assertion/reflection library (http://fest.easytesting.org/)
C#
309
star
2

CQRS

A simple project to explain CQRS during a live coding session at MS experiences'16
C#
143
star
3

Value

a pico library (or code snippets shed) to help you to easily implement Value Types in your C# projects without making errors nor polluting your domain logic with boiler-plate code.
C#
86
star
4

Diverse

Diverse, the Fuzzer pico library you need to make your .NET tests more Diverse
C#
34
star
5

me-myself-and-i

A repository to list all my public interventions (talks, live coding sessions, etc)
17
star
6

SmokeMe

A convention-based dotnet plugin that will automatically expose all your declared smoke tests behind a /smoke resource in your API.
C#
16
star
7

liveCoding-HexagonalFromScratch

Live coding session to illustrate the usage of Hexagonal Architecture
C#
6
star
8

logging-guidelines

4
star
9

talk-outside-in-diamond-tdd

The slides of Thomas' talk about outside-in diamond tdd style
3
star
10

wiked

wiked! is a markdown-based web site template to start all your pragmatic (and DRY) project KM with
3
star
11

kata-office-carpaccio

Instructions for the Elephant Carpaccio kata (Thomas' version, inspired by the Office tv series)
3
star
12

personal-writings

A place to share some documents, writings
3
star
13

CQRS-slides

slides for MS experiences'16 event
3
star
14

outside-in-hexagonal

A greenfield code kata to show how to build a system following the outside-in TDD approach and relying on the hexagonal architecture
C#
3
star
15

NFluent-Web

(alpha) NFluent.Web is an extension library to NFluent for web-related tests. NFluent is an ergonomic assertion library which aims to fluent your .NET TDD experience (based on simple Check.That() assertion statements). NFluent aims your tests to be fluent to write (with an happy 'dot' auto completion experience), fluent to read (i.e. as close as possible to plain English expression), but also fluent to troubleshoot, in a less-error-prone way comparing to the classical .NET test frameworks. NFluent is also directly inspired by the awesome Java FEST Fluent assertion/reflection library (http://fest.easytesting.org/)
C#
3
star
16

kata-tic-tac-toe

Tic-tac-toe kata
C#
2
star
17

kata-GildedRose

(kata) Gilded Rose
C#
2
star
18

Tmp

C#
2
star
19

talk-beyond-hexagonal-architecture

Slides for our talk: Beyond Hexagonal Architecture
2
star
20

talk-hexagonal-and-beyond

For an upcoming session
2
star
21

MarsRovers

(kata) Code kata described here: http://www.techinterviewpuzzles.com/2010/09/mars-rovers-thoughtworks-puzzles.html
C#
1
star
22

Slides

A repository for all the slides and keynote supports.
1
star
23

writings

A repo with some of our writings about software
1
star
24

karaoke-powerpoint

Decks for Power point karaoke sessions
1
star
25

SmokeMe.TestAdapter

Test runner and adapter to transform your SmokeMe! smoke tests into integration tests.
C#
1
star