-
Notifications
You must be signed in to change notification settings - Fork 23
Logbook 7
A Logbook entry written by @tpierrain
After few debates on twitter and a blog post to clarify why Hexagonal Architecture != Layers in my opinion, I decided to show an example of code to the community in order to continue the discussion. Since I'm not allowed to push some code outside my company, I started to reawaken the #SORLunchBox pet project to make it hexagonal.
I took me few days (of delay) since I could only work on it during the transports (metro, train,...) and few early mornings. The most important task was to move out our Market naive implementation into another project (with a new name: ApiMarketGateway).
To help you to grasp what the Smart Routing System (SOR) is and how its Hexagonal Architecture articulates for it, I also draw some sketches.
And before someone is telling me:
I'd like to add few...
-
The #SORlunchbox project is quite young and immature implementation (it's just a beginning). As of today:
-
It support 1 financial instrument only (implicit within the code ;-(
-
Even if it's event driven, the code is mainly synchronous ;-(next step will be to make it reactive and thus asynchronous)
-
There are many missing opportunities to use proper 'DDD' Value types (i.e. to replace all the decimal prices (primitive obsession) with an Amount Value type embedding the currency for instance)
-
...
-
Watch only the CSharp code since the FSharp version is even younger
Ok. That being said, we can now having a look at the code. To focus on the hexagonal architecture specificity, I recommend you to start by watching:
- SorAcceptanceTests
- CompositionRootHelper
- and the number of projects within the solution (Domain, Infra, Tests, Console & fake thirdparty for market connection)
Hope this will clarify what Hexagonal Architecture is and how it articulates.