hexagonal architecture

presentation by roman stocker

why this presentation?

  • europa3000 AG
    • europa3000 FT2/FT3
    • multiple websites (Classic ASP/ASP.NET)
    • ERP API consuming web client (ASP.NET)
  • Maxomedia AG
    • multiple websites based on Kentico CMS (WebForms)
  • apload GmbH
    • multiple websites based on a own CMS (Classic ASP)
    • new CMS based on ASP.NET Core MVC
  • Post CH AG
    • BillingOnline
    • TechSys

architecture

architecture

  • lateinisch: architectūra
  • griechisch:
    • ἀρχή (arché): anfang, ursprung, grundlage, das erste
    • τέχνη (téchne): kunst, handwerk (auch tectum, lateinisch für gebäude)
  • handwerkliche beschäftigung und ästhetische auseinandersetzung des menschen mit dem gebauten raum
  • planvolles entwerfen, gestalten und konstruieren von bauwerken
  • wechselbeziehung zwischen mensch, raum und zeit

sources: https://de.wiktionary.org/wiki/Architektur und https://de.wikipedia.org/wiki/Architektur

architecture in it

  • Umfasst alle statischen und dynamischen Aspekte
  • Umfasst Gebiete wie:
    • infrastruktur (hardware, location, network)
    • software
    • technologies
    • interfaces
    • IT-business functions and processes
    • architecture-management (configuration- and capacity planning, load balancing, backup, availability, reliability, disaster planning etc.)

sources: https://de.wikipedia.org/wiki/IT-Architektur

definition

  • Beschreibt die grundlegenden Komponenten
  • Zeigt das Zusammenspiel innerhalb eines Systems auf
  • Ist eine Zerlegung des Ganzen in einzelne Architekturkomponenten
„eine strukturierte oder hierarchische Anordnung der Systemkomponenten sowie Beschreibung ihrer Beziehungen“.

Helmut Balzert: Lehrbuch der Softwaretechnik

characteristics

  • multitude of stakeholders
  • separation of concerns
  • quality-driven
  • recurring styles
  • conceptual integrity
  • cognitive constraints

types of architecture

  • enterprise architecture DE / EN
  • solution architecture EN
  • software architecture DE / EN
  • integration architecture DE / EN
  • data architecture DE / EN
  • security architecture DE / EN
  • infrastructure architecture DE / EN

levels of architecture

event driven architecture hexagonal architecture

conclusion

  • is important, if you don't want to have unexpected troubles
  • has to work on all level
  • there isn't a correct or a wrong architecture
  • no decision about selecting an architecture doesn't mean, you don't use any
  • should be documented and up to date

architecture patterns vs. design patterns

software architecture patterns

some examples:

  • service-oriented architecture
  • multitier architecture
  • model-view-contoller
  • event-driven architecture
  • broker pattern

sources: architekturmuster DE / EN

software design patterns

some examples:

  • dependency injection
  • observer pattern
  • proxy pattern
  • adapter pattern
  • chain-of-responsibility pattern
  • state pattern

sources: entwurfsmuster DE / EN

horizontal vs. vertical architektur

horizontal architektur

vertical architektur

hexagonal architecture

history

components

source: dossier-andreas.net

dependencies

source: blog.cleancoder.com

data flow

source: softwarecampament.wordpress.com

customization

source: herbertograca.com

differences

  • naming
  • "layers"

sources: maibornwolff.de and herbertograca.com

when to use?

  • it depends!
  • maybe not in small projects
  • combination of
    • long life cycle
    • should be modified many times
    • changing technology or frameworks
  • testing is important

sources: softwarecampament.wordpress.com

pros and cons

benefits

  • independent of frameworks
  • testable
  • independent of UI
  • independent of database
  • independent of any external agency

sources: blog.cleancoder.com

disadvantage

  • higher level of complexity
  • build process performance
  • over-engineering

sources: pguardiola.com and softwarecampament.wordpress.com

review

learnings

  • takes a lot of time
  • not accessible essential websites are ***
  • a lot of inconsistency in www
  • a lot of combinations are possible
  • destroyed my lovely horizontal mvc
  • new perspectives away from database/model driven

result

  • no working code example
  • 170+ lines of structered notes
  • 30+ commits in git
  • ?! hours of work
  • found a lot of exciting resources
  • not finished yet

side effects

  • micro frontends
  • test driven development
  • CQRS
  • event-driven architecture

questions?

https://hexagonalarchitecture.roman-stocker.ch/