SlideShare une entreprise Scribd logo
1  sur  100
Télécharger pour lire hors ligne
Legacy application
 Large ambitions
     A case study: how DDD helped
     deliver at Sungard Asset Arena


Cyrille Martraire - @cyriux -
http://cutefunnyanimal.blogspot.in/2012/01/funny-tired-dogs-photos-images-2012.html
LEGACY
Passionate
developer
    PARIS
  Since 1999

   @cyriux
Paris Software
Craftsmanship Community




     http://www.meetup.com/paris-software-craftsmanship/
Arolla




Arolla.fr
A Case Study
From a recent project (contract)


 Every example is made-up to
   protect the innocent IP.
Once upon a time…
Large Ambition
Asset Management
Buy, Partner or Make?
Buy, Partner or Make?
Project Life
                     +QA
                            +Dev             Dev++
              +BA
  PH
   AS
      E1




2010             2011               PH
                                              2012
           PH




                                    AS
              AS




                                       E
                 E




                           PH




                                         4
               2




                           AS
                              E 3
“You’ve got the right
      skills
   We trust you.
    Deliver”
So how do we do that?
?
PH
                               AS
                                  E 1
         Spike!

          3-weeks
Deliberate Discovery in mind
Codeanalysis
                           [Greg Young]




Within 3 weeks
   1. Conversations with experts
   2. Code the understanding & note questions
   3. Iterate




http://skillsmatter.com/podcast/design-architecture/mystery-ddd/js-4401
Find the Domain Experts
The official expert
(former Asset Manager)
Proxy Domain Experts
Proxy Domain Experts
Haz Context?

                       “Trade” = ?
         Sell-Side
           (Hedging)     Broker
                          (A Vs. B)


                                      Buy-Side
                                      (investment)

                       + fees!

Accounting                                           Accounting
(tax, Basel etc)                                     (tax, accuracy,
                                                      boring stuff)
Fossilized Domain
                    Expertise




http://newspaper.li/fossil/
Conversations first
     • Ask *good* questions
     • Build respect and confidence

     • Beware and care about
       synonyms and main
       concepts



http://journalism.about.com/od/reporting/tp/Finding-And-Developing-Ideas-For-News-Stories-
Sketching
Sketching
Sketching
Growing our
    Ubiquitous Language
                                                         Collecting scenarios
 An instrument is effective for a period of time (its life), that
 is the date range between the effective date and the expiry
 date
                                                                     A credit leg observes credit events from some identified
                                                                     instrument and triggers either a physical settlement or to a cash
                                                                     settlement.
 A swap is made of legs, each of them being an independent          Typical credit events are bankruptcy, failure to pay, restructuring



 other counterparty
                                     Cash
 instrument on its own. Each leg defines two counterparties
 A payoff is a cash flow given by one counterparty to the

 Instruments generate cash flows during their life, in
                                                                     Forward and Future means that the effective date is in the future.
                                                                     The difference between forward and future is that the former is OTC
                                                                     whereas the later is cleared, more standard, and involves frequent
                                                                     margin calls (hence a convexity bias between them)
                                                                     From a legal perspective, an option is the right to exercise some
 particular at expiry date (redemption, zero coupon) and at          transaction, typically to buy/sell the underlying instrument at a
 regular dates

                                     Flow
 There may be a date offset for settlements, fixings and cash
 flows payments
                                                                     predefined strike and volume, or to receive a payoff. Since investors
                                                                     are rational, we may also consider options to be essentially
                                                                     instruments with conditional transaction, in general payoffs




Bank
 Floating rate devices generate cash flows according to              Option styles are typically European (exercise only at expiry date),
                                                                     American (exercise anytime), Bermuda (exercise at regular dates),
 observation expressions based on some observable                    Canary (exercise at regular dates after some date or period)
 reference
                                                                     An underlying instrument is an instrument used to condition the
 Fixed rate devices generate cash flows according to a               exercise (which may be automatic) and often used to calculate the
 predefined coupon                                                    amount of the payoff or more that is directly the object of an
 Inflation-linked devices modulate the coupon, coupon rate           exchange, in the case of an exchange of assets
 or notional amount by the variation of some (inflation)              Some instruments are subject to conversion, i.e. they can be
 observable reference                                                replaced with another instrument


  Interest rate
Holiday
 Regular dates may be predefined explicitly as a dates list, or
 as repeated dates defined by a period and a time direction
 (backward or forward), with stub convention and date
 adjustment rules, and according to some holiday calendar
                                                                     Some instruments involve one, two or no exchange(s) of principal
                                                                     (s)
                                                                     Compounding swaps capitalize interests earned for each period
                                                                     payment period
 Date adjustment rules are defined by a day roll convention
 and a business center
 A funding leg is a fixed rate device or a floating rate device
 A return leg is a leg that reproduces the exact cash flows of
 another instrument
Taking notes, in code

Class, interface names & documentation
Fields
Relationships (if any)

+ Behavior!
Code doesn’t lie

Got something wrong?
 Forgot something?
   It shows!
Found a metaphor




http://www.marksmart.net/gearhack/pogomoog/pogomoog.html
Found a metaphor
             Modular Synthesizer




Martin Russ - http://eetimes.com/design/audio-design/4238388
FoundJava code
   In a metaphor


           Output of a class/
          function is the input
               of another
So let’s keep on coding
    and rebuilding
      everything!
    Sounds like a great idea!
http://skillsmatter.com/podcast/design-architecture/talk-from-eric-evans
Plenty of Legacy code
 working since 1993

   Redoing = waste + risk
Still need to redo some
         parts

 How do we integrate with legacy?
   Where do we stop redoing?
PH
                                        AS
                                           E 2
     Legacy strategy

        Know your enemies
Asset Capture & Strangler Application
       Bubble Context & ACL
           Scream it loud
Know your enemies
 [discover the app]


   Read the documents
   Interview people
   Use the application
   Read the code
   Fix bugs
Visualize
      [primary flow & support features]




http://www.fimarkets.com/pagesen/back-middle-front-office.php
Visualize
      [primary flow & support features]




http://www.fimarkets.com/pagesen/back-middle-front-office.php
Visualize
      [primary flow & support features]




http://www.fimarkets.com/pagesen/back-middle-front-office.php
Asset
                                          Inventory




http://staff.bath.ac.uk/enssa/LPDev.htm
Asset Capture
                                  Transmission

                                          Exhaust



                                                  Engine




http://martinfowler.com/bliki/AssetCapture.html
Asset Capture
                                  Transmission

                                          Exhaust



                                                  Engine

      Focus on one single asset : the engine

http://martinfowler.com/bliki/AssetCapture.html
Strangler
       application
            A new module will
               progressively
            strangle the former
             one, for one single
                 asset only
http://martinfowler.com/bliki/StranglerApplication.html
http://www.flickr.com/photos/louisfoecy/4114597043
Conservative by default
    • Keep existing architecture
        – N-tiers, application server,
          middleware
        – Same database
        – Same UI technology



        – (Almost) all the legacy code


Diagrams shamelessly stolen from Eric Evans DDDx 2011 talk
Bubble Context
• Create a little bubble of
  innovation

• Brand new model

• As clean as we like
• Highly tested
• High hygiene standards
Bubble Context
• ACL to protect from the
  legacy code

• Translates legacy
  objects & services into
  new, cleaner ones
Strangler (cont.)

• Progressively
  turn off legacy
  functionalities &
  turn on the new
  ones
Agree on maxims
[communicate the plan]

          • “Only one work
            site at a time:
            instruments”
          • “When in
            Rome, do as
            Romans do”
PH
                             AS
                                E 3
Scaling development in
  the bubble context

        Infect the team
         Code as SPOT
    High hygiene standards
       Functional-style
I only care about
    Java EE 6
Hey!
Finance
is cool!
Oh, this
 domain is
really cool!
Oh, this
I’d like to    domain is
  know it     really cool!
  better!
Invest in domain
   knowledge




          • Bi-weekly 30mn
            training sessions
Signal to Noise ratio




http://www.flickr.com/photos/28471130@N07/2666802097
Signal to Noise Ratio
• SNR ≥ 80 %

• Signal: CashFlow, CashFlowSequence,
 CashFlowEngine, FinancialProduct,
 BankHolidays, ReferenceData


• Noise: CashFlowBuilder,
 CompositeEngine, ProductFactory,
 BankHolidaysDecorator
“All what you explained
is nice, but what about
  the actual code and
        design?”

              -client
Code as reference
       [export the glossary]

• Annotate domain-relevant classes



• Custom Doclet to export Excel-formatted
  glossary of every domain concept
• Send directly to end customers as
  reference documentation
High hygiene standards
       [in the bubble context]

• Dependencies
  – Legacy
  – Middleware
  – Frameworks
  – Database stuff


     null
                     + TDD, BDD
                     + Clean Code
“Functional-First” style
“Functional-First” style

• Value Objects (Quantity, Range…) as
  much as possible
  – Immutable
• Side-effect-free functions
• Closure of operations
  – CashFlow and CashFlowsSequence
   add(), negate(), multiply()
PH
                             AS
                                E 4
Legacy: the bigger
     picture

 Clarify bubble boundaries
     Emerging contexts
       Shock absorber
    Responsibility layers
First boundaries

                     <<ValueObject>>
                          <<ValueObje
  <<ValueObject>>
     <<ValueObje              ct
       <<ValueObje
         ct ct




    <<Entity>>
   <<Aggregate>>




    <<Service>>       <<Service>>
     <<API>>           <<SPI>>
boundaries 2.0

                      <<ValueObject>>
                           <<ValueObje
  <<ValueObject>>
     <<ValueObje               ct
       <<ValueObje
         ct ct




                                         Look Ma:
                     <<Service>>
  <<Service>>         <<SPI>>            no entity
   <<API>>                               in there!

  <<Entity>>
 <<Aggregate>>
boundaries 2.0

                                   <<ValueObject>>
                                        <<ValueObje
                     X
                 <<ValueObje
              <<ValueObject>>               ct
                    <<ValueObje
                      ct ct



As Value
 Object
                                  <<Service>>
 inside       <<Service>>          <<SPI>>
               <<API>>
As Entity
 outside
                   X
              <<Entity>>
             <<Aggregate>>
Just a lib & side-effect
          free!

                                    <<ValueObject>>
                                         <<ValueObje
            <<ValueObject>>
               <<ValueObje                   ct
                 <<ValueObje
                   ct ct




                                   <<Service>>
            <<Service>>             <<SPI>>
             <<API>>




Values in                      Values out
API



SPI
ACL-backed Domain
         service
• Unify *many* legacy       <<ACL>>
  services through one     <<Facade>>


  single & simple
  interface

• Hide the most
  unfriendly legacy code
                           <<old stuff I don’t
                           want to deal with>>
Initial journey toward
   our dream model


        Bespoke custom
         DREAM MODEL
Dream model must pass
          every scenario
Given a floating rate bond on EURIBOR 3M
And a nominal of 15M EUR
And an issue date of 2011/06/15
And an end date of 2012/06/14
And an SEMI_ANNUAL calculation period

When the EURIBOR 3M evolves:
    | 2011/09/15 | 3.5% |
    | 2012/03/15 | 4.0% |

Then the cash-flows are:
                                      Bespoke custom
    | 2011/12/13 | 23000 |             DREAM MODEL
    | 2012/06/14 | 25500 |
Deliberately easier by
    construction


        Bespoke custom
            library
Conflicting aspects
suggest several contexts




“I don’t need all these data
to do that, I just need these
3 fields”
Context Game
              [Greg Young]

 “What's your ideal <instrument>?”
• Pre-trade: very liquid with a narrow bid – offer
  spread
• Trading: unique identifier easy to key in
• Risk: has risk on a single risk factor
• Back-office: very few cash-flows that are
  certain and known long beforehand
Contexts that emerged
                              Risk
                         <<legacy>>


 Trading
 <<legacy>>
                                      Cash-flows
                                       <<strangler>>
                     CRUD
                   <<legacy POJO>>



              Hibernate ORM




                          DB
                       <<legacy>>
Contexts that emerged
                              Risk
                         <<legacy>>


 Trading
 <<legacy>>
                                      Cash-flows
                                       <<strangler>>
                     CRUD
                   <<legacy POJO>>



              Hibernate ORM




                          DB
                       <<legacy>>
Contexts that emerged
                              Risk
                        <<strangler>>


 Trading
 <<legacy>>
                                        Cash-flows
                                         <<strangler>>
                     CRUD
                   <<legacy POJO>>



              Hibernate ORM




                          DB
                       <<legacy>>
Team /manager invoke
          DRY
                          Risk
                       <<strangler>>


    Trading
     <<legacy>>
                                       Cash-flows
                                        <<strangler>>
                     CRUD
                   <<legacy POJO>>
“I don’t want to maintain
more models, it’s already
               Hibernate ORM


hard enough!”
                         DB
                      <<legacy>>
Team /manager invoke
          DRY
                          Risk
                       <<strangler>>


    Trading
     <<legacy>>
                                       Cash-flows
                                          <<strangler>>
                     CRUD
                   <<legacy POJO>>
“I don’t want to maintain               No it’s less
more models, it’s already
               Hibernate ORM           maintenance!

hard enough!”
                         DB
                      <<legacy>>
How do we integrate?
                              Risk
                        <<strangler>>


Trading



                        ?
 <<legacy>>
                                        Cash-flows
                                         <<strangler>>
                     CRUD
                   <<legacy POJO>>



              Hibernate ORM




                          DB
                       <<legacy>>
Contexts Mappings
                             Risk
                       <<strangler>>


Trading
<<legacy>>
                                        Cash-flows
                                           <<strangler>>
                    CRUD
                  <<legacy POJO>>



             Hibernate ORM
                                         Non DDD
                                         (anemic),
                                       already there
                         DB
                      <<legacy>>
ACL as Shock Absorbers




http://www.directindustry.com/prod/herwarth-reich/flexible-couplings-elastic-couplings-19991-374565.html
ACL as Shock Absorbers




http://www.monition.com/images/shaft-alignment-training.jpg
“That’s useless code!”
No, ACL’s are good!
“Ok so I will automate”
No, hand-crafted code is
         good!
CO
                         NC
                           LU
                             SI
                               ON
Happy End

 Project delivered
On required scope
     On time
Client satisfaction
Some remarks

• “DDD + R&D potential”: my projects
  selection criteria

• DDD: subtle, often not quite *sure*

• Don’t preach, tell the benefits
The future

• Keep on growing the model in the bubble
  context

• Reuse in another context (e.g.
  accounting)? - To what extent?

• The bubble may break at some point
Questions?

You can also ask me later!
Merci

Contenu connexe

En vedette

Refactor your specs! Øredev 2013
Refactor your specs! Øredev 2013Refactor your specs! Øredev 2013
Refactor your specs! Øredev 2013Cyrille Martraire
 
Tour d'horizon de Domain-Driven Design Avril 2012 autour d'un retour d'expéri...
Tour d'horizon de Domain-Driven Design Avril 2012 autour d'un retour d'expéri...Tour d'horizon de Domain-Driven Design Avril 2012 autour d'un retour d'expéri...
Tour d'horizon de Domain-Driven Design Avril 2012 autour d'un retour d'expéri...Cyrille Martraire
 
Bdd for legacy system
Bdd for legacy systemBdd for legacy system
Bdd for legacy systemSpin Lai
 
About "Apache Cassandra"
About "Apache Cassandra"About "Apache Cassandra"
About "Apache Cassandra"Jihyun Ahn
 
HTTP demystified for web developers
HTTP demystified for web developersHTTP demystified for web developers
HTTP demystified for web developersPeter Hilton
 
From legacy to DDD - 5 starting steps
From legacy to DDD - 5 starting stepsFrom legacy to DDD - 5 starting steps
From legacy to DDD - 5 starting stepsAndrzej Krzywda
 
Tom and jef’s awesome modellathon
Tom and jef’s awesome modellathonTom and jef’s awesome modellathon
Tom and jef’s awesome modellathonTom Janssens
 
Documentation avoidance for developers
Documentation avoidance for developersDocumentation avoidance for developers
Documentation avoidance for developersPeter Hilton
 
Moving away from legacy code (AgileCymru)
Moving away from legacy code  (AgileCymru)Moving away from legacy code  (AgileCymru)
Moving away from legacy code (AgileCymru)Konstantin Kudryashov
 
How to write maintainable code
How to write maintainable codeHow to write maintainable code
How to write maintainable codePeter Hilton
 
Death to project documentation with eXtreme Programming
Death to project documentation with eXtreme ProgrammingDeath to project documentation with eXtreme Programming
Death to project documentation with eXtreme ProgrammingAlex Fernandez
 
Moving away from legacy code with BDD
Moving away from legacy code with BDDMoving away from legacy code with BDD
Moving away from legacy code with BDDKonstantin Kudryashov
 
Evolving legacy to microservices and ddd
Evolving legacy to microservices and dddEvolving legacy to microservices and ddd
Evolving legacy to microservices and dddMarcos Vinícius
 
Simplifying your design with higher-order functions
Simplifying your design with higher-order functionsSimplifying your design with higher-order functions
Simplifying your design with higher-order functionsSamir Talwar
 
How to write good comments
How to write good commentsHow to write good comments
How to write good commentsPeter Hilton
 
How to name things: the hardest problem in programming
How to name things: the hardest problem in programmingHow to name things: the hardest problem in programming
How to name things: the hardest problem in programmingPeter Hilton
 
Railway Oriented Programming
Railway Oriented ProgrammingRailway Oriented Programming
Railway Oriented ProgrammingScott Wlaschin
 

En vedette (20)

Refactor your specs! Øredev 2013
Refactor your specs! Øredev 2013Refactor your specs! Øredev 2013
Refactor your specs! Øredev 2013
 
Tour d'horizon de Domain-Driven Design Avril 2012 autour d'un retour d'expéri...
Tour d'horizon de Domain-Driven Design Avril 2012 autour d'un retour d'expéri...Tour d'horizon de Domain-Driven Design Avril 2012 autour d'un retour d'expéri...
Tour d'horizon de Domain-Driven Design Avril 2012 autour d'un retour d'expéri...
 
DDD: Context is King
DDD: Context is KingDDD: Context is King
DDD: Context is King
 
Bdd for legacy system
Bdd for legacy systemBdd for legacy system
Bdd for legacy system
 
About "Apache Cassandra"
About "Apache Cassandra"About "Apache Cassandra"
About "Apache Cassandra"
 
HTTP demystified for web developers
HTTP demystified for web developersHTTP demystified for web developers
HTTP demystified for web developers
 
Writing the docs
Writing the docsWriting the docs
Writing the docs
 
From legacy to DDD - 5 starting steps
From legacy to DDD - 5 starting stepsFrom legacy to DDD - 5 starting steps
From legacy to DDD - 5 starting steps
 
Tom and jef’s awesome modellathon
Tom and jef’s awesome modellathonTom and jef’s awesome modellathon
Tom and jef’s awesome modellathon
 
Documentation avoidance for developers
Documentation avoidance for developersDocumentation avoidance for developers
Documentation avoidance for developers
 
Selling ddd
Selling dddSelling ddd
Selling ddd
 
Moving away from legacy code (AgileCymru)
Moving away from legacy code  (AgileCymru)Moving away from legacy code  (AgileCymru)
Moving away from legacy code (AgileCymru)
 
How to write maintainable code
How to write maintainable codeHow to write maintainable code
How to write maintainable code
 
Death to project documentation with eXtreme Programming
Death to project documentation with eXtreme ProgrammingDeath to project documentation with eXtreme Programming
Death to project documentation with eXtreme Programming
 
Moving away from legacy code with BDD
Moving away from legacy code with BDDMoving away from legacy code with BDD
Moving away from legacy code with BDD
 
Evolving legacy to microservices and ddd
Evolving legacy to microservices and dddEvolving legacy to microservices and ddd
Evolving legacy to microservices and ddd
 
Simplifying your design with higher-order functions
Simplifying your design with higher-order functionsSimplifying your design with higher-order functions
Simplifying your design with higher-order functions
 
How to write good comments
How to write good commentsHow to write good comments
How to write good comments
 
How to name things: the hardest problem in programming
How to name things: the hardest problem in programmingHow to name things: the hardest problem in programming
How to name things: the hardest problem in programming
 
Railway Oriented Programming
Railway Oriented ProgrammingRailway Oriented Programming
Railway Oriented Programming
 

Similaire à Domain-Driven Design in legacy application

Arch CoP - Domain Driven Design.pptx
Arch CoP - Domain Driven Design.pptxArch CoP - Domain Driven Design.pptx
Arch CoP - Domain Driven Design.pptxSanjoy Kumar Roy
 
Keys to Successful M&A: Transparency, Security, and Process
Keys to Successful M&A: Transparency, Security, and ProcessKeys to Successful M&A: Transparency, Security, and Process
Keys to Successful M&A: Transparency, Security, and ProcessSecureDocs
 
Understanding Compound‘s Liquidation
Understanding Compound‘s LiquidationUnderstanding Compound‘s Liquidation
Understanding Compound‘s LiquidationTal Be'ery
 
What are the differences between staking, liquidity mining &amp; yield farming
What are the differences between staking, liquidity mining &amp; yield farming What are the differences between staking, liquidity mining &amp; yield farming
What are the differences between staking, liquidity mining &amp; yield farming Brugusoftwaresolutions
 
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101Simone Onofri
 
Accounting for Depreciation.docx
Accounting for Depreciation.docxAccounting for Depreciation.docx
Accounting for Depreciation.docxKrishna2017
 
ASAS 2013 - Agility and the essence of software architecture
ASAS 2013 - Agility and the essence of software architectureASAS 2013 - Agility and the essence of software architecture
ASAS 2013 - Agility and the essence of software architectureAvisi B.V.
 
2871f ratio analysis
2871f ratio analysis2871f ratio analysis
2871f ratio analysisahsanjawadca
 
Effective Segregation of Duties for PeopleSoft 2011-02-23
Effective Segregation of Duties for PeopleSoft 2011-02-23Effective Segregation of Duties for PeopleSoft 2011-02-23
Effective Segregation of Duties for PeopleSoft 2011-02-23Smart ERP Solutions, Inc.
 
Digital Tokens: Accountability & Transparency Framework
Digital Tokens: Accountability & Transparency FrameworkDigital Tokens: Accountability & Transparency Framework
Digital Tokens: Accountability & Transparency FrameworkJordan Price
 
CH 2, INVESTMENT ALTERNATIVES.pptx
CH 2, INVESTMENT ALTERNATIVES.pptxCH 2, INVESTMENT ALTERNATIVES.pptx
CH 2, INVESTMENT ALTERNATIVES.pptxFabioTatontos
 
Learn Fundamentals of Decentralized Finance - 101blockchains
Learn Fundamentals of Decentralized Finance - 101blockchainsLearn Fundamentals of Decentralized Finance - 101blockchains
Learn Fundamentals of Decentralized Finance - 101blockchainsJackSmith435850
 

Similaire à Domain-Driven Design in legacy application (20)

Derivatives
DerivativesDerivatives
Derivatives
 
Project Management 06
Project Management 06Project Management 06
Project Management 06
 
Arch CoP - Domain Driven Design.pptx
Arch CoP - Domain Driven Design.pptxArch CoP - Domain Driven Design.pptx
Arch CoP - Domain Driven Design.pptx
 
Keys to Successful M&A: Transparency, Security, and Process
Keys to Successful M&A: Transparency, Security, and ProcessKeys to Successful M&A: Transparency, Security, and Process
Keys to Successful M&A: Transparency, Security, and Process
 
Understanding Compound‘s Liquidation
Understanding Compound‘s LiquidationUnderstanding Compound‘s Liquidation
Understanding Compound‘s Liquidation
 
Term Sheet Basics
Term Sheet BasicsTerm Sheet Basics
Term Sheet Basics
 
What are the differences between staking, liquidity mining &amp; yield farming
What are the differences between staking, liquidity mining &amp; yield farming What are the differences between staking, liquidity mining &amp; yield farming
What are the differences between staking, liquidity mining &amp; yield farming
 
Blockchain Glossary
Blockchain GlossaryBlockchain Glossary
Blockchain Glossary
 
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
 
Accounting for Depreciation.docx
Accounting for Depreciation.docxAccounting for Depreciation.docx
Accounting for Depreciation.docx
 
ASAS 2013 - Agility and the essence of software architecture
ASAS 2013 - Agility and the essence of software architectureASAS 2013 - Agility and the essence of software architecture
ASAS 2013 - Agility and the essence of software architecture
 
Guide to First Home Buyers
Guide to First Home BuyersGuide to First Home Buyers
Guide to First Home Buyers
 
2871f ratio analysis
2871f ratio analysis2871f ratio analysis
2871f ratio analysis
 
Effective Segregation of Duties for PeopleSoft 2011-02-23
Effective Segregation of Duties for PeopleSoft 2011-02-23Effective Segregation of Duties for PeopleSoft 2011-02-23
Effective Segregation of Duties for PeopleSoft 2011-02-23
 
Digital Tokens: Accountability & Transparency Framework
Digital Tokens: Accountability & Transparency FrameworkDigital Tokens: Accountability & Transparency Framework
Digital Tokens: Accountability & Transparency Framework
 
Final Report
Final ReportFinal Report
Final Report
 
CH 2, INVESTMENT ALTERNATIVES.pptx
CH 2, INVESTMENT ALTERNATIVES.pptxCH 2, INVESTMENT ALTERNATIVES.pptx
CH 2, INVESTMENT ALTERNATIVES.pptx
 
Learn Fundamentals of Decentralized Finance - 101blockchains
Learn Fundamentals of Decentralized Finance - 101blockchainsLearn Fundamentals of Decentralized Finance - 101blockchains
Learn Fundamentals of Decentralized Finance - 101blockchains
 
Focalequity Premium Services Presentation
Focalequity Premium Services PresentationFocalequity Premium Services Presentation
Focalequity Premium Services Presentation
 
030211 econ investing part 2 100m
030211 econ investing part 2 100m030211 econ investing part 2 100m
030211 econ investing part 2 100m
 

Plus de Cyrille Martraire

Domain modeling for Digital Transformations (FlowCon Paris 2019 edition)
Domain modeling for Digital Transformations (FlowCon Paris 2019 edition)Domain modeling for Digital Transformations (FlowCon Paris 2019 edition)
Domain modeling for Digital Transformations (FlowCon Paris 2019 edition)Cyrille Martraire
 
Sunny Tech 2019 - Craft Forever
Sunny Tech 2019 - Craft ForeverSunny Tech 2019 - Craft Forever
Sunny Tech 2019 - Craft ForeverCyrille Martraire
 
Hexagonal at Scale, with DDD and microservices! - Voxxed Days microservices 2...
Hexagonal at Scale, with DDD and microservices! - Voxxed Days microservices 2...Hexagonal at Scale, with DDD and microservices! - Voxxed Days microservices 2...
Hexagonal at Scale, with DDD and microservices! - Voxxed Days microservices 2...Cyrille Martraire
 
Bounded Context - DDD Europe Foundation Track
Bounded Context - DDD Europe Foundation TrackBounded Context - DDD Europe Foundation Track
Bounded Context - DDD Europe Foundation TrackCyrille Martraire
 
Domain Modeling towards First Principles
Domain Modeling towards First PrinciplesDomain Modeling towards First Principles
Domain Modeling towards First PrinciplesCyrille Martraire
 
DDD beyond the infamous repository pattern - GeeCon Prague 2018
DDD beyond the infamous repository pattern - GeeCon Prague 2018DDD beyond the infamous repository pattern - GeeCon Prague 2018
DDD beyond the infamous repository pattern - GeeCon Prague 2018Cyrille Martraire
 
Les effets inattendus du passage en Features Teams à grande échelle -ScrumDay...
Les effets inattendus du passage en Features Teams à grande échelle -ScrumDay...Les effets inattendus du passage en Features Teams à grande échelle -ScrumDay...
Les effets inattendus du passage en Features Teams à grande échelle -ScrumDay...Cyrille Martraire
 
Refactor your Specs - 2017 Edition
Refactor your Specs - 2017 EditionRefactor your Specs - 2017 Edition
Refactor your Specs - 2017 EditionCyrille Martraire
 
Interviewing Domain Experts - Heuristics From the Trenches (DDD Europe 2016 M...
Interviewing Domain Experts - Heuristics From the Trenches (DDD Europe 2016 M...Interviewing Domain Experts - Heuristics From the Trenches (DDD Europe 2016 M...
Interviewing Domain Experts - Heuristics From the Trenches (DDD Europe 2016 M...Cyrille Martraire
 
Ur Domain Haz Monoids DDDx NYC 2014
Ur Domain Haz Monoids DDDx NYC 2014Ur Domain Haz Monoids DDDx NYC 2014
Ur Domain Haz Monoids DDDx NYC 2014Cyrille Martraire
 

Plus de Cyrille Martraire (12)

Domain modeling for Digital Transformations (FlowCon Paris 2019 edition)
Domain modeling for Digital Transformations (FlowCon Paris 2019 edition)Domain modeling for Digital Transformations (FlowCon Paris 2019 edition)
Domain modeling for Digital Transformations (FlowCon Paris 2019 edition)
 
Sunny Tech 2019 - Craft Forever
Sunny Tech 2019 - Craft ForeverSunny Tech 2019 - Craft Forever
Sunny Tech 2019 - Craft Forever
 
Hexagonal at Scale, with DDD and microservices! - Voxxed Days microservices 2...
Hexagonal at Scale, with DDD and microservices! - Voxxed Days microservices 2...Hexagonal at Scale, with DDD and microservices! - Voxxed Days microservices 2...
Hexagonal at Scale, with DDD and microservices! - Voxxed Days microservices 2...
 
Bounded Context - DDD Europe Foundation Track
Bounded Context - DDD Europe Foundation TrackBounded Context - DDD Europe Foundation Track
Bounded Context - DDD Europe Foundation Track
 
Domain Modeling towards First Principles
Domain Modeling towards First PrinciplesDomain Modeling towards First Principles
Domain Modeling towards First Principles
 
DDD beyond the infamous repository pattern - GeeCon Prague 2018
DDD beyond the infamous repository pattern - GeeCon Prague 2018DDD beyond the infamous repository pattern - GeeCon Prague 2018
DDD beyond the infamous repository pattern - GeeCon Prague 2018
 
DDD for real
DDD for realDDD for real
DDD for real
 
Les effets inattendus du passage en Features Teams à grande échelle -ScrumDay...
Les effets inattendus du passage en Features Teams à grande échelle -ScrumDay...Les effets inattendus du passage en Features Teams à grande échelle -ScrumDay...
Les effets inattendus du passage en Features Teams à grande échelle -ScrumDay...
 
Refactor your Specs - 2017 Edition
Refactor your Specs - 2017 EditionRefactor your Specs - 2017 Edition
Refactor your Specs - 2017 Edition
 
Interviewing Domain Experts - Heuristics From the Trenches (DDD Europe 2016 M...
Interviewing Domain Experts - Heuristics From the Trenches (DDD Europe 2016 M...Interviewing Domain Experts - Heuristics From the Trenches (DDD Europe 2016 M...
Interviewing Domain Experts - Heuristics From the Trenches (DDD Europe 2016 M...
 
Ur Domain Haz Monoids DDDx NYC 2014
Ur Domain Haz Monoids DDDx NYC 2014Ur Domain Haz Monoids DDDx NYC 2014
Ur Domain Haz Monoids DDDx NYC 2014
 
Ur Domain Haz Monoids
Ur Domain Haz MonoidsUr Domain Haz Monoids
Ur Domain Haz Monoids
 

Dernier

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 

Dernier (20)

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 

Domain-Driven Design in legacy application

  • 1. Legacy application Large ambitions A case study: how DDD helped deliver at Sungard Asset Arena Cyrille Martraire - @cyriux -
  • 4. Passionate developer PARIS Since 1999 @cyriux
  • 5. Paris Software Craftsmanship Community http://www.meetup.com/paris-software-craftsmanship/
  • 8. From a recent project (contract) Every example is made-up to protect the innocent IP.
  • 9. Once upon a time…
  • 12.
  • 15. Project Life +QA +Dev Dev++ +BA PH AS E1 2010 2011 PH 2012 PH AS AS E E PH 4 2 AS E 3
  • 16. “You’ve got the right skills We trust you. Deliver”
  • 17. So how do we do that?
  • 18. ?
  • 19. PH AS E 1 Spike! 3-weeks Deliberate Discovery in mind
  • 20. Codeanalysis [Greg Young] Within 3 weeks 1. Conversations with experts 2. Code the understanding & note questions 3. Iterate http://skillsmatter.com/podcast/design-architecture/mystery-ddd/js-4401
  • 21. Find the Domain Experts
  • 22. The official expert (former Asset Manager)
  • 25. Haz Context? “Trade” = ? Sell-Side (Hedging) Broker (A Vs. B) Buy-Side (investment) + fees! Accounting Accounting (tax, Basel etc) (tax, accuracy, boring stuff)
  • 26. Fossilized Domain Expertise http://newspaper.li/fossil/
  • 27. Conversations first • Ask *good* questions • Build respect and confidence • Beware and care about synonyms and main concepts http://journalism.about.com/od/reporting/tp/Finding-And-Developing-Ideas-For-News-Stories-
  • 31. Growing our Ubiquitous Language Collecting scenarios An instrument is effective for a period of time (its life), that is the date range between the effective date and the expiry date A credit leg observes credit events from some identified instrument and triggers either a physical settlement or to a cash settlement. A swap is made of legs, each of them being an independent Typical credit events are bankruptcy, failure to pay, restructuring other counterparty Cash instrument on its own. Each leg defines two counterparties A payoff is a cash flow given by one counterparty to the Instruments generate cash flows during their life, in Forward and Future means that the effective date is in the future. The difference between forward and future is that the former is OTC whereas the later is cleared, more standard, and involves frequent margin calls (hence a convexity bias between them) From a legal perspective, an option is the right to exercise some particular at expiry date (redemption, zero coupon) and at transaction, typically to buy/sell the underlying instrument at a regular dates Flow There may be a date offset for settlements, fixings and cash flows payments predefined strike and volume, or to receive a payoff. Since investors are rational, we may also consider options to be essentially instruments with conditional transaction, in general payoffs Bank Floating rate devices generate cash flows according to Option styles are typically European (exercise only at expiry date), American (exercise anytime), Bermuda (exercise at regular dates), observation expressions based on some observable Canary (exercise at regular dates after some date or period) reference An underlying instrument is an instrument used to condition the Fixed rate devices generate cash flows according to a exercise (which may be automatic) and often used to calculate the predefined coupon amount of the payoff or more that is directly the object of an Inflation-linked devices modulate the coupon, coupon rate exchange, in the case of an exchange of assets or notional amount by the variation of some (inflation) Some instruments are subject to conversion, i.e. they can be observable reference replaced with another instrument Interest rate Holiday Regular dates may be predefined explicitly as a dates list, or as repeated dates defined by a period and a time direction (backward or forward), with stub convention and date adjustment rules, and according to some holiday calendar Some instruments involve one, two or no exchange(s) of principal (s) Compounding swaps capitalize interests earned for each period payment period Date adjustment rules are defined by a day roll convention and a business center A funding leg is a fixed rate device or a floating rate device A return leg is a leg that reproduces the exact cash flows of another instrument
  • 32. Taking notes, in code Class, interface names & documentation Fields Relationships (if any) + Behavior!
  • 33. Code doesn’t lie Got something wrong? Forgot something? It shows!
  • 35. Found a metaphor Modular Synthesizer Martin Russ - http://eetimes.com/design/audio-design/4238388
  • 36. FoundJava code In a metaphor Output of a class/ function is the input of another
  • 37.
  • 38. So let’s keep on coding and rebuilding everything! Sounds like a great idea!
  • 40. Plenty of Legacy code working since 1993 Redoing = waste + risk
  • 41. Still need to redo some parts How do we integrate with legacy? Where do we stop redoing?
  • 42. PH AS E 2 Legacy strategy Know your enemies Asset Capture & Strangler Application Bubble Context & ACL Scream it loud
  • 43. Know your enemies [discover the app] Read the documents Interview people Use the application Read the code Fix bugs
  • 44. Visualize [primary flow & support features] http://www.fimarkets.com/pagesen/back-middle-front-office.php
  • 45. Visualize [primary flow & support features] http://www.fimarkets.com/pagesen/back-middle-front-office.php
  • 46. Visualize [primary flow & support features] http://www.fimarkets.com/pagesen/back-middle-front-office.php
  • 47. Asset Inventory http://staff.bath.ac.uk/enssa/LPDev.htm
  • 48. Asset Capture Transmission Exhaust Engine http://martinfowler.com/bliki/AssetCapture.html
  • 49. Asset Capture Transmission Exhaust Engine Focus on one single asset : the engine http://martinfowler.com/bliki/AssetCapture.html
  • 50. Strangler application A new module will progressively strangle the former one, for one single asset only http://martinfowler.com/bliki/StranglerApplication.html http://www.flickr.com/photos/louisfoecy/4114597043
  • 51. Conservative by default • Keep existing architecture – N-tiers, application server, middleware – Same database – Same UI technology – (Almost) all the legacy code Diagrams shamelessly stolen from Eric Evans DDDx 2011 talk
  • 52. Bubble Context • Create a little bubble of innovation • Brand new model • As clean as we like • Highly tested • High hygiene standards
  • 53. Bubble Context • ACL to protect from the legacy code • Translates legacy objects & services into new, cleaner ones
  • 54. Strangler (cont.) • Progressively turn off legacy functionalities & turn on the new ones
  • 55. Agree on maxims [communicate the plan] • “Only one work site at a time: instruments” • “When in Rome, do as Romans do”
  • 56. PH AS E 3 Scaling development in the bubble context Infect the team Code as SPOT High hygiene standards Functional-style
  • 57.
  • 58. I only care about Java EE 6
  • 60.
  • 61. Oh, this domain is really cool!
  • 62. Oh, this I’d like to domain is know it really cool! better!
  • 63. Invest in domain knowledge • Bi-weekly 30mn training sessions
  • 64. Signal to Noise ratio http://www.flickr.com/photos/28471130@N07/2666802097
  • 65. Signal to Noise Ratio • SNR ≥ 80 % • Signal: CashFlow, CashFlowSequence, CashFlowEngine, FinancialProduct, BankHolidays, ReferenceData • Noise: CashFlowBuilder, CompositeEngine, ProductFactory, BankHolidaysDecorator
  • 66. “All what you explained is nice, but what about the actual code and design?” -client
  • 67. Code as reference [export the glossary] • Annotate domain-relevant classes • Custom Doclet to export Excel-formatted glossary of every domain concept • Send directly to end customers as reference documentation
  • 68. High hygiene standards [in the bubble context] • Dependencies – Legacy – Middleware – Frameworks – Database stuff null + TDD, BDD + Clean Code
  • 70. “Functional-First” style • Value Objects (Quantity, Range…) as much as possible – Immutable • Side-effect-free functions • Closure of operations – CashFlow and CashFlowsSequence add(), negate(), multiply()
  • 71. PH AS E 4 Legacy: the bigger picture Clarify bubble boundaries Emerging contexts Shock absorber Responsibility layers
  • 72. First boundaries <<ValueObject>> <<ValueObje <<ValueObject>> <<ValueObje ct <<ValueObje ct ct <<Entity>> <<Aggregate>> <<Service>> <<Service>> <<API>> <<SPI>>
  • 73. boundaries 2.0 <<ValueObject>> <<ValueObje <<ValueObject>> <<ValueObje ct <<ValueObje ct ct Look Ma: <<Service>> <<Service>> <<SPI>> no entity <<API>> in there! <<Entity>> <<Aggregate>>
  • 74. boundaries 2.0 <<ValueObject>> <<ValueObje X <<ValueObje <<ValueObject>> ct <<ValueObje ct ct As Value Object <<Service>> inside <<Service>> <<SPI>> <<API>> As Entity outside X <<Entity>> <<Aggregate>>
  • 75. Just a lib & side-effect free! <<ValueObject>> <<ValueObje <<ValueObject>> <<ValueObje ct <<ValueObje ct ct <<Service>> <<Service>> <<SPI>> <<API>> Values in Values out
  • 77. ACL-backed Domain service • Unify *many* legacy <<ACL>> services through one <<Facade>> single & simple interface • Hide the most unfriendly legacy code <<old stuff I don’t want to deal with>>
  • 78. Initial journey toward our dream model Bespoke custom DREAM MODEL
  • 79. Dream model must pass every scenario Given a floating rate bond on EURIBOR 3M And a nominal of 15M EUR And an issue date of 2011/06/15 And an end date of 2012/06/14 And an SEMI_ANNUAL calculation period When the EURIBOR 3M evolves: | 2011/09/15 | 3.5% | | 2012/03/15 | 4.0% | Then the cash-flows are: Bespoke custom | 2011/12/13 | 23000 | DREAM MODEL | 2012/06/14 | 25500 |
  • 80. Deliberately easier by construction Bespoke custom library
  • 81. Conflicting aspects suggest several contexts “I don’t need all these data to do that, I just need these 3 fields”
  • 82. Context Game [Greg Young] “What's your ideal <instrument>?” • Pre-trade: very liquid with a narrow bid – offer spread • Trading: unique identifier easy to key in • Risk: has risk on a single risk factor • Back-office: very few cash-flows that are certain and known long beforehand
  • 83. Contexts that emerged Risk <<legacy>> Trading <<legacy>> Cash-flows <<strangler>> CRUD <<legacy POJO>> Hibernate ORM DB <<legacy>>
  • 84. Contexts that emerged Risk <<legacy>> Trading <<legacy>> Cash-flows <<strangler>> CRUD <<legacy POJO>> Hibernate ORM DB <<legacy>>
  • 85. Contexts that emerged Risk <<strangler>> Trading <<legacy>> Cash-flows <<strangler>> CRUD <<legacy POJO>> Hibernate ORM DB <<legacy>>
  • 86. Team /manager invoke DRY Risk <<strangler>> Trading <<legacy>> Cash-flows <<strangler>> CRUD <<legacy POJO>> “I don’t want to maintain more models, it’s already Hibernate ORM hard enough!” DB <<legacy>>
  • 87. Team /manager invoke DRY Risk <<strangler>> Trading <<legacy>> Cash-flows <<strangler>> CRUD <<legacy POJO>> “I don’t want to maintain No it’s less more models, it’s already Hibernate ORM maintenance! hard enough!” DB <<legacy>>
  • 88. How do we integrate? Risk <<strangler>> Trading ? <<legacy>> Cash-flows <<strangler>> CRUD <<legacy POJO>> Hibernate ORM DB <<legacy>>
  • 89. Contexts Mappings Risk <<strangler>> Trading <<legacy>> Cash-flows <<strangler>> CRUD <<legacy POJO>> Hibernate ORM Non DDD (anemic), already there DB <<legacy>>
  • 90. ACL as Shock Absorbers http://www.directindustry.com/prod/herwarth-reich/flexible-couplings-elastic-couplings-19991-374565.html
  • 91. ACL as Shock Absorbers http://www.monition.com/images/shaft-alignment-training.jpg
  • 94. “Ok so I will automate”
  • 96. CO NC LU SI ON Happy End Project delivered On required scope On time Client satisfaction
  • 97. Some remarks • “DDD + R&D potential”: my projects selection criteria • DDD: subtle, often not quite *sure* • Don’t preach, tell the benefits
  • 98. The future • Keep on growing the model in the bubble context • Reuse in another context (e.g. accounting)? - To what extent? • The bubble may break at some point
  • 99. Questions? You can also ask me later!
  • 100. Merci