How Bounded Contexts

Shape Frontend Architecture

Tomasz Ducin  β€’  ducin.dev  β€’  Bottega IT Minds

How Bounded Contexts

Shape Frontend Architecture

Tomasz Ducin  β€’  ducin.dev  β€’  Bottega IT Minds

Software Architecture

Architecture has goals

Architecture evolves

Architecture is a resultant force

Key Frontend Architecture concern:

Modularity

Hi, I'm Tomasz

tomasz (at) ducin.dev

πŸ¦‹ @ducin.dev

𝕏  @tomasz_ducin

Independent Consultant & Software Architect

Trainer, Speaker, Frontend & Backend

Bottega IT Minds, ArchitekturaNaFroncie.pl (ANF),

Developer Jutra .pl (DJ)

Warsaw, PL

πŸ€”

  • what problem are we trying to solve?
  • how do we know a problem is a problem?
  • what causes the problem?
  • what are the alternatives?
  • what problems do we introduce (accidentally)?

what is more important πŸ€”

 

QUESTIONS or ANSWERS?

 

 

QUESTIONS

Semantic Boundaries

client state:

  • ID
  • name
  • descriptions, tags, images
  • categories
  • price
  • ratings
  • [...]

client state:

  • ID
  • customer
  • quantity
  • shipment limitations
  • [...]

client state:

  • ID
  • quantity
  • price
  • tax
  • country-specific tax regulations
  • [...]

Bounded Context

Bounded Context

- a boundary within which a (specific and consistent) domain model and a (common, unambiguous) language applies

- linguistic boundary

client state:

  • ID
  • quantity
  • price
  • tax
  • country-specific tax regulations
  • [...]

client state:

  • ID
  • customer
  • quantity
  • shipment limitations
  • [...]

client state:

  • ID
  • name
  • descriptions, tags, images
  • categories
  • price
  • ratings
  • [...]

product.price

product.price

==?

product.rating

product.rating

==?

client state:

  • ID
  • quantity
  • price
  • tax
  • country-specific tax regulations
  • [...]

client state:

  • ID
  • customer
  • quantity
  • shipment limitations
  • [...]

client state:

  • ID
  • name
  • descriptions, tags, images
  • categories
  • price
  • ratings
  • [...]

STATE

STATE

STATE

how about LOGIC?

UI logic and domain logic?

πŸ€”

Heuristics

for distilling bounded contexts

Business Process:
Separate Steps

Alternative Inputs

Alternative Outputs

Information used together

Information which change together

Anti-Requirements

and many, many more...

Anti-Corruption Layer 🧱

❔

❌

FE, BE - separate

Bounded Contexts?

🀨

Client State (Coupling)

Canonical Data Model

Canonical Data Model

- standardized representation of data that serves as a common ground for different systems and applications to exchange and understand data.

Decoupling? πŸ‘‰|πŸ‘ˆ 

🫨

πŸ˜’ we don't approve

🀬 it's NOT in the docs

Deployment Architecture

is that rocket science?

2 questions:

do frontend devs think about it?

"Every piece of knowledge must have a single, unambiguous, authoritative representation within a system"


- "The Pragmatic Programmer", A. Hunt, D Thomas

Monorepos

monorepos

apps/

  app-A/...

  app-B/...

libs/

  lib-X/...

  lib-Y/...

  lib-Z/...

monorepos

apps/

  app-A/...

  app-B/...

libs/

  lib-X/...

  lib-Y/...

  lib-Z/...

monorepos

apps/

  app-A/...

  app-B/...

libs/

  lib-X/...

  lib-Y/...

  lib-Z/...

😁

  • szybsze buildy
  • Ε‚atwiejsze podbijanie paczek
  • wiΔ™kszy "porzΔ…dek"

module boundaries

apps/

  app-A/...

  app-B/...

libs/

  lib-X/...

  lib-Y/...

  lib-Z/...

❌

❌

❌

❌

❌

monorepos

libs/

  flights/

  tickets/

  profiles/

  shared/

  ...

apps/

  application :)

db

api

ui

tickets

tickets

tickets

"DDD in Angular"

(Different) Actors 🎭

πŸ‘·

🀡

πŸ›’οΈπŸ€–

🚚

πŸ€–

OMG... that means we gotta talk to people... a lot

🫨

I studied Computer Science
to avoid talking to people

πŸ˜“

Business Goals πŸ“ˆ

Modularity & LLMs

The Art of Destroying Software

Greg Young, https://www.youtube.com/watch?v=Ed94CfxgsCA

Heuristics are tools

"Nothing is more dangerous than an idea when it is the only one you have."

 

- Emile Chartier Alain

Thank you

Tomasz Ducin  β€’  ducin.dev

How Bounded Contexts shape Frontend Architecture (Devoxx)

By Tomasz Ducin

How Bounded Contexts shape Frontend Architecture (Devoxx)

  • 458