Upload
xebia-france
View
126
Download
0
Embed Size (px)
Citation preview
Construire le SI de demain
REX Société Générale La simplicité comme moyen d'être
performant, résilient et de réduire le Time To Market
Marie-Laure Thuret
@mlthuret
Développeur chez
Clément Héliou
@c_heliou
Développeur chez
ThierryAbaléa
@ThierryAbalea
Tech Leadà la
Société Générale
Palladium
Commodity Trading Company
Today
Hedging
Commodity Trading Company
Commodity Trading Company
Few Months Later
Hedging
Physical Delivery
Sales PersonCustomer Trader
Booking
Exchanges
Automatize the processus
OrchestratorCustomer ExchangesPricer
Booking
Hedger
Trading LimitMargin
The Constraints
Reliability / Resilience Performance
Productivity / Time To Market
Our Solution
Simplicity
Simple ≠ Easy
Choices are business-oriented
Functional and Code
Reduce the impedance between
Our Goal
Orchestration
Let’s take an example with our main component
Event Sourcing
« Capture all changes to an application state as a
sequence of events »Martin Fowler
Date Money Out Money In
2015/05/14 100
2015/05/14 -20
2015/05/16 -30
2015/05/24 380
2015/06/01 -70
Total -120 480
Balance 360
WithdrawalPerformed
accountId: 9387amount: 30€
BankAccount
id: 9387balance: 0€
WithdrawalPerformed
accountId: 9387amount: 20€
DepositPerformed
accountId: 9387amount: 100€
BankAccount
id: 9387balance: 50€
BankAccount
id: 9387balance: 100€
BankAccount
id: 9387balance: 80€
Inspired by B. Reitzammer & J. Seitz - http://ookami86.github.io/event-sourcing-in-practice
Apply to
Apply to
Apply to
Produces
Produces
Produces
J. Chassaing - http://thinkbeforecoding.com/post/2014/01/04/Event-Sourcing.-Draw-it
BankAccount
id: 9387balance: 0€
WithdrawalPerforme
accountId: 9387amount: 20€
DepositPerformed
accountId: 9387amount: 100€
BankAccount
id: 9387balance: 100€
Bug
Inspired by B. Reitzammer & J. Seitz - http://ookami86.github.io/event-sourcing-in-practice
Apply to
Apply to
Produces
Produces
WithdrawalPerformed
accountId: 9387amount: 30€
BankAccount
id: 9387balance: 0€
WithdrawalPerformed
accountId: 9387amount: 20€
DepositPerformed
accountId: 9387amount: 100€
BankAccount
id: 9387balance: 100€
BankAccount
id: 9387balance: 70€
Inspired by B. Reitzammer & J. Seitz - http://ookami86.github.io/event-sourcing-in-practice
Apply to
Apply to
Produces
Produces
Domain Driven Design
« DDD is about designing software based on models
of the underlying (business) domain »
Martin Fowler
Ubiquitous Language
RepositoryAggregate Root
EntityValue Object
Durable business model
Extensibility
Clean Architecture
Solid Responsibility Segregation
Using Event Sourcing and DDD concepts in
Multiplus
Multiplus Business
Logic
ReceiveQuote{command}
QuoteReceived{event}
QuoteForwarded{event}
Customer
Event Bus
QuoteForwardedHandler{handler}
Quote Requestin Quoting
QuoteReceived{event}
QuoteReceived{event}
ForwardQuote{action}
Transaction{aggregate root}
Pricing{entity}
Execution{entity}
Orchestration{entity}
ReceiveQuote{command/value object}
quoteRequestId: 4563price: 100€
QuoteReceived{event/value object}
accountId: 4563price: 110€
- Multiplus Business Logic -
What we’ve learned
Be aware of
Command Sourcing
Multiplus Business
Logic
ReceiveQuote{command}
quoteRequestId: 4563price: 100€
QuoteForwarded{event}
accountId: 4563price: 101€
Multiplus Business
Logic
ReceiveQuote{command}
quoteRequestId: 4563price: 100€
QuoteForwarded{event}
accountId: 4563price: 102€
2015/06/01 Margin: 1%
2015/11/01 Margin: 2%
Multiplus Business
Logic
ReceiveQuote{command}
QuoteForwarded{event}
Customer
Event Bus
QuoteForwardedHandler{handler}
{Quote n° 65746}{Quote n° 65746} ??
QuoteReceived{event}
ForwardQuote{action}
Multiplus Business
Logic
ReceiveQuote{command}
QuoteForwarded{event}
Customer
Event Bus
QuoteForwardedHandler{handler}
Customer gateway
{Quote n° 65746}
{Quote n° 65746}
QuoteReceived{event}
ForwardQuote{action}
Store the events produced by the
Decide function
Multiplus Business
Logic
ReceiveQuote{command}
quoteRequestId: 4563price: 100€
QuoteForwarded{event}
accountId: 4563price: 101€
Multiplus Business
Logic
2015/06/01 Margin: 1%
2015/11/01 Margin: 2%
QuoteForwarded{event}
accountId: 4563price: 101€
Multiplus Business
Logic
ReceiveQuote{command}
QuoteForwarded{event}
Customer
Event Bus
QuoteForwardedHandler{handler}
QuoteReceived{event}
ForwardQuote{action}
It’s all in the past !
Date Money Out Money In
2015/05/14 100
2015/05/14 -20
2015/05/16 -30
2015/05/24 30
2015/06/01 -70
Total -120 130
Balance 10
Behavior Driven Development
Conversation
Collaboration
Specifications By Examples
Three Amigos
Automation
Ubiquitous Language
deliverthe rightsoftware
Yourdocumentationwill becomealive
youwill
new comersthank
youwill
new comersthank
… but you’ll enjoy it too !
warning
doing BDD right
easyis not
BDDCommon Issues
Business and developper faces collaboration difficulties
Mess with the scenario writing
Automation Nightmare
BDDCommon Issues
Business and developper faces collaboration difficulties
Mess with the scenario writing
Automation Nightmare
our
complexapplication
areoften
we tend to let
everywherebusiness rules
being dispatch
… making them
hard to test
Hexagonal Architecture
the onion architecturethe clean architecture
ports and adapters
Advantages
Testability Flexibility
Business Centric
domain driven app structure
that’s not
enough !
use differentgranularity
business scenarioswhen expressing your
levels
Given a quantity value of 1000 in GWhen the quantity is converted in OZThen the converted quantity is 32.1507 OZ
Given a quote request with a way BUYAnd the credit check request has been sentWhen the credit check response is in errorThen the pricer does not receive a quote requestAnd the platform quote status is REJECTED
Given an authorized product typeWhen the customer sends the rfsThen the pricer receives the rfsWhen the pricer sends a quoteThen the customer receives the quote
Workflow
Feature
Unit
« l’enfer c’est les autres »
Jean-Paul Sartre
at
any timebusiness validation
steroidsintegration testing
on
care aboutthe contract
between your app and another
avoidaccidentalcomplexity
there’s always
implicit
a schemaeven if it’s
Hexagonal Architecture
DDDEvent Sourcing
BDD
State Machine
Hexagonal Architecture
Java
DDDEvent Sourcing
BDD
State Machine
Hexagonal Architecture
DaggerJava
DDDEvent Sourcing
BDD
State Machine
Hexagonal Architecture
DaggerJava
Guava
DDDEvent SourcingBDD
State Machine
Our architecture is easy to deploy !
Simple
Simple
No More Technologies Than Required
Simple
No More Technologies Than Required
Business Centric
Simple
No More Technologies Than Required
Business Centric
Code Understanding is Key
Simple
No More Technologies Than Required
Business Centric
CourageCode Understanding is Key
Any Questions ?