Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building a sustainable architecture

Building a sustainable architecture

As software engineers we are always trying to be more productive, to deliver better code, and to have a faster development feedback.
In this talk, we’ll explore how functional programming, tests and hexagonal architecture
can perform great together in order to support a maintainable codebase for hundreds of engineers and services.
Diving deeper on how we can levarage hexagonal architecture with dependency rejection in order to decouple decisions from effects,
resulting in a code that is easier to reason, compose and test.

The codebase is not the only one that take advantages from that, but also the developers.
It helps everyone feels more comfortable and engaged about maintaining good practices.
This is already proven to work really well at Nubank, which is considered the best bank in Brazil according to Forbes.

Carolina Pascale Campos

November 09, 2019
Tweet

More Decks by Carolina Pascale Campos

Other Decks in Programming

Transcript

  1. x y

  2. why not imperative? const block = (card, db, producer) =>

    { if(canBlock(card)) { const blockedCard = logicCard.block(card); datomicCard.update(blockedCard, db); producerCard.statusChanged(blockedCard, producer) } }
  3. why not imperative? const blockAll = (customer, cards, db, producer)

    => { cards .map(card => block(card, db, producer)) cardsBlockNotify(customer, producer) }
  4. why not imperative? const blockAll = (customer, cards, db, producer)

    => { cards .map(card => block(card, db, producer)) cardsBlockNotify(customer, producer) }
  5. why not imperative? const blockAll = (customer, cards, db, producer)

    => { cards .map(card => block(card, db, producer)) cardsBlockNotify(customer, producer) }
  6. const block = (card) => { if(canBlock(card)) { const blockedCard

    = block(card); return { effectsDatoms: [effectsCard.update(blockedCard)], effectsMessages: [effectsCard.statusChanged(blockedCard)] }; } }
  7. easier to compose const blockAll = (customer, cards) => {

    cards .map(card => block(card)) .map(effect => effectsCard.cardsBlockedNotify (effect, customer)) }