Bottom-up Architecture: Bridging the Architecture-Code Gap • Oliver Drotbohm • GOTO 2024

Learn how to express architectural patterns directly in code using type systems, tools & frameworks to bridge the gap between high-level design and implementation.

Key takeaways
  • Architecture and code exist at different levels of abstraction - architecture deals with high-level concepts and modules while code is very specific with classes and methods

  • Architecturally evident code expresses architectural ideas and design intent directly in the codebase through type systems, annotations, and naming conventions

  • Tools like JQAssistant, ArcUnit and jMolecules help bridge the architecture-code gap by:

    • Identifying architectural concepts in code
    • Verifying architectural rules
    • Generating documentation
    • Enabling testability
  • DDD tactical patterns (aggregates, value objects, repositories) can be expressed in code using annotations and type systems to enforce architectural rules

  • Package structures and modules can be used to implement architectural patterns like onion/hexagonal architecture while maintaining testability and separation of concerns

  • Spring Boot and Spring Framework provide mechanisms to implement architectural concepts through stereotypes, module conventions and testing slices

  • Moving architectural concepts into code helps with:

    • Documentation that stays current
    • Compile-time verification
    • Onboarding new team members
    • Making architecture more maintainable
  • Tools should support gradual adoption in existing codebases rather than requiring full rewrites

  • Architecture should be expressed through stronger means than just naming conventions - using type systems and compile-time verification

  • Focus should be on making architectural abstractions workable and usable in application code rather than just theoretical concepts