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

A craftsman’s guide to designing clean architecture

A craftsman’s guide to designing clean architecture

In this talk, Software Craftsman Marcus Biel describes how to design a Clean Architecture

5fada8ab2d8d053004959c1a3dc68a31?s=128

Marcus Biel

April 07, 2018
Tweet

Transcript

  1. Marcus Biel, Software Craftsman Moscow | 7. April 2018 A

    craftsman’s guide to designing clean architecture
  2. Copyright 2018 Marcus Biel https://cleancodeacademy.com About me Clean Code Evangelist

    • Founder of Clean Code Academy • Public Speaker • Author • Java Influencer • JCP Member • Clean Code Coach • Java Consultant @MarcusBiel marcus@cleancodeacademy.com
  3. Copyright 2018 Marcus Biel https://cleancodeacademy.com Defining a Clean Architecture

  4. Copyright 2018 Marcus Biel https://cleancodeacademy.com Defining a Clean Architecture

  5. Copyright 2018 Marcus Biel https://cleancodeacademy.com Defining a Clean Architecture

  6. Copyright 2018 Marcus Biel https://cleancodeacademy.com Defining a Clean Architecture MODULES

    PACKAGES CLASSES METHODS
  7. Copyright 2018 Marcus Biel https://cleancodeacademy.com Defining a Clean Architecture Domain

    Infrastructure HTTPS REST SOAP
  8. Copyright 2018 Marcus Biel https://cleancodeacademy.com Foundation of a Clean Architecture

    ‣ Coupling and Cohesion ‣ Other Building Blocks
  9. Copyright 2018 Marcus Biel https://cleancodeacademy.com Defining Coupling Tight Coupling Loose

    Coupling
  10. Copyright 2018 Marcus Biel https://cleancodeacademy.com Defining Coupling Tight Coupling Loose

    Coupling
  11. Copyright 2018 Marcus Biel https://cleancodeacademy.com Defining Coupling Tight Loose

  12. Copyright 2018 Marcus Biel https://cleancodeacademy.com Coupling Strength ‣ Distance of

    the Components ‣ Type of Coupling ‣ Timing of Coupling
  13. Copyright 2018 Marcus Biel https://cleancodeacademy.com Distance of the Components MODULES

    PACKAGES CLASSES METHODS
  14. Copyright 2018 Marcus Biel https://cleancodeacademy.com Distance of the Components

  15. Copyright 2018 Marcus Biel https://cleancodeacademy.com Distance of the Components

  16. Copyright 2018 Marcus Biel https://cleancodeacademy.com Distance of the Components

  17. Copyright 2018 Marcus Biel https://cleancodeacademy.com Distance of the Components

  18. Copyright 2018 Marcus Biel https://cleancodeacademy.com Type of Coupling

  19. Copyright 2018 Marcus Biel https://cleancodeacademy.com Timing of Coupling

  20. Copyright 2018 Marcus Biel https://cleancodeacademy.com Defining Cohesion Low Cohesion High

    Cohesion
  21. Copyright 2018 Marcus Biel https://cleancodeacademy.com Defining Cohesion Low Cohesion High

    Cohesion
  22. Copyright 2018 Marcus Biel https://cleancodeacademy.com Low High Defining Cohesion

  23. Copyright 2018 Marcus Biel https://cleancodeacademy.com Defining Cohesion GeneralUtils create(Customer) validate(Car)

    write(Report)
  24. Copyright 2018 Marcus Biel https://cleancodeacademy.com Defining Cohesion CustomerService sellTo(Customer) invoice(Customer)

    help(Customer)
  25. Copyright 2018 Marcus Biel https://cleancodeacademy.com help(Customer) invoice(Customer) Defining Cohesion CustomerSales

    sellTo(Customer) CustomerAccounting CustomerService
  26. Copyright 2018 Marcus Biel https://cleancodeacademy.com Cohesion Types ‣ Logical Cohesion

    ‣ Business Cohesion
  27. Copyright 2018 Marcus Biel https://cleancodeacademy.com Cohesion Key Point High Cohesion

    requires in-depth knowledge of the domain.
  28. Copyright 2018 Marcus Biel https://cleancodeacademy.com Foundation of a Clean Architecture

    ‣ Coupling and Cohesion ‣ Other Building Blocks
  29. Copyright 2018 Marcus Biel https://cleancodeacademy.com Other Building Blocks ‣ Encapsulation

    ‣ Naming ‣ Size
  30. Copyright 2018 Marcus Biel https://cleancodeacademy.com Encapsulation technically enforces of how

    the system should be used Getters and Setters violate encapsulation. Use package private more often! http://bit.ly/EvilGettersAndSetters
  31. Copyright 2018 Marcus Biel https://cleancodeacademy.com Other Building Blocks ‣ Encapsulation

    ‣ Naming ‣ Size
  32. Copyright 2018 Marcus Biel https://cleancodeacademy.com Clean Names Key Points Clean

    names drive high cohesion 
 (Customer, AccountNumber) Use service pattern judiciously Clean names are team work Rename on new insights
  33. Copyright 2018 Marcus Biel https://cleancodeacademy.com Other Building Blocks ‣ Encapsulation

    ‣ Naming ‣ Size
  34. Copyright 2018 Marcus Biel https://cleancodeacademy.com Size Key Points MODULES PACKAGES

    CLASSES METHODS
  35. Copyright 2018 Marcus Biel https://cleancodeacademy.com What is Clean Architecture? I

    would advise students to pay more attention to the fundamental ideas rather than the latest technology. The technology will be out-of-date before they graduate. Fundamental ideas never get out of date. — David L. Parnas “ ”
  36. Marcus Biel, Software Craftsman Moscow | 7. April 2018 A

    craftsman’s guide to designing clean architecture