Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Software-Hygiene

338 views

Published on

Software-Hygiene oder was man von Blutgruppen über die Strukturierung von Software lernen kann



Agile Softwarearchitektur erschöpft sich oft im Begriff ‚inkrementell‘. Agile Methoden setzen Werte an die Stelle von Prozessen. Werte leiten das freie Handeln. Was ist das Pendant auf der Seite der Architektur? Architekturen können inkrementell entstehen, wenn sie durch Begriffe und Metaphern orientiert sind.

Das meist rezipierte Architekturkonzept im agilen Kontext ist Domain Driven Design (DDD). Es erweist sich als hilfreicher Kompass in Software-Projekten, die auf die Gestaltung von strukturierten Anwendungskernen abzielen. Wir stellen mit Quasar eine weitere Methode vor, die die Trennung von technischen und fachlichen Komponenten (Software-Hygiene) ins Zentrum stellt. Quasar hilft durch die Metapher der Blutgruppen bei einer sauberen Strukturierung von Anwendungen.

Wir werden die zentralen Begriffe von Quasar erläutern. Mit ihrer Hilfe machen wir einen Aspekt des DDD sichtbar, der dort vorausgesetzt, aber nicht als „first class citizen“ verhandelt wird.

Die Zuhörerin sollte am Ende der Session in der Lage sein, einen auf DDD basierenden Anwendungskern zu entwickeln, der fachliche und technische Aspekte strikt trennt und das Infektionsrisiko minimiert.

Präsentation von Sven Bange und Jens Himmelreich, gehalten auf den XPDays 2017 in Stuttgart.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Software-Hygiene

  1. 1. S O F T W A R E 
 H Y G I E N E X P D A Y S S T U T T G A R T 2 0 1 7
  2. 2. oder was man von Blutgruppen über die Strukturierung von Software lernen kann
  3. 3. sven bange jens himmelreich N E U L A N D - B Ü R O F Ü R I N F O R M A T I K
  4. 4. 
 ARCHITEKTUR AGILE

  5. 5. ARCHITEKTDER EINSAME
  6. 6. Plan
  7. 7. ARCHITEKT
  8. 8. ARCHITEKT
  9. 9. ARCHITEKTUR evolvierend, inkrementell
  10. 10. Werte
  11. 11. Muster
  12. 12. Werte und Muster werden global kommuniziert und machen lokal handlungsfähig.
  13. 13. Big Ball of Mud
  14. 14. sauber einfach strukturiert aufgeräumt willkürlich chaotisch wuchernd schmutzig
  15. 15. 1 8 4 8 Ignaz Semmelweis
  16. 16. „Erkennung, Behandlung und Prävention
 von Infektionskrankheiten“ H Y G I E N E
  17. 17. „Erkennung, Behandlung und Prävention
 von Infektionskrankheiten“ E R K E N N U N G
  18. 18. Bedside-Test A B 0
  19. 19. A B AB0
  20. 20. A B AB0 0 A B AB Spender Empfänger x xx xx x x xx
  21. 21. Serafol® ABO Anti-A Anti-B
  22. 22. Serafol® AB0 Anti-A Anti-B
  23. 23. Serafol® AB0 Anti-A Anti-B
  24. 24. Serafol® AB0 Anti-BAnti-A
  25. 25. Big Ball of Mud
  26. 26. Johannes Siedersleben sd&m Q U A S A R
  27. 27. „Software, die sich unterschiedlich schnell ändert, wird in unterschiedliche Module aufgeteilt.“ David Parnas
  28. 28. A B AB0
  29. 29. A T AT0
  30. 30. universell verfügbare Software A T AT0
  31. 31. Anwendungs-Software A T AT0
  32. 32. Technische Software A T AT0
  33. 33. Big Ball of Mud A T AT0
  34. 34. Repräsentation A T AT/R0
  35. 35. A T R0
  36. 36. A T R0 0 A T R Aufgerufener Aufrufer x xx xx x x xx
  37. 37. Quasar Quasar® AT0 Anti-TAnti-A
  38. 38. „Erkennung, Behandlung und Prävention
 von Infektionskrankheiten“ H Y G I E N E
  39. 39. „Erkennung, Behandlung und Prävention
 von Infektionskrankheiten“ B E H A N D L U N G
  40. 40. TREN ∙ NUNG
  41. 41. Domain Driven Design Eric Evans, Vaughn Vernon
  42. 42. I. Bounded Context A B C
  43. 43. II. A-Software ∙ T-Software
  44. 44. III. Domain Model
  45. 45. Trennwand
  46. 46. R-Software
  47. 47. Hexagon
  48. 48. Hexagon Port and Adapter Application Domain
  49. 49. Hexagon WebController AppService Aggregate Repository EntityValueObject DomainServiceDomainEvent RepositoryImpl WebRequest Port and Adapter Application Domain JDBCObject
  50. 50. A-Software WebController AppService Aggregate Repository EntityValueObject DomainServiceDomainEvent RepositoryImpl WebRequest Port and Adapter Application Domain JDBCObject Aggregate Repository EntityValueObject DomainServiceDomainEvent
  51. 51. T-Software WebController AppService Aggregate Repository EntityValueObject DomainServiceDomainEvent RepositoryImpl WebRequest Port and Adapter Application Domain JDBCObject WebRequest JDBCObject
  52. 52. R-Software WebController AppService Aggregate Repository EntityValueObject DomainServiceDomainEvent RepositoryImpl WebRequest Port and Adapter Application Domain JDBCObject WebController AppService RepositoryImpl
  53. 53. B E I S P I E L
  54. 54. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  55. 55. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  56. 56. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  57. 57. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  58. 58. @Controller public class WebController { @Autowired private GreetingApplicationService greetingApplicationService; @RequestMapping("/") public String home(Model model) { GreetingData greeting = greetingApplicationService.welcomePeople(); model.addAttribute("salutation", greeting.getSalutation()); model.addAttribute("name", greeting.getName()); return "home"; } }
  59. 59. @Controller public class WebController { @Autowired private GreetingApplicationService greetingApplicationService; @RequestMapping("/") public String home(Model model) { GreetingData greeting = greetingApplicationService.welcomePeople(); model.addAttribute("salutation", greeting.getSalutation()); model.addAttribute("name", greeting.getName()); return "home"; } }
  60. 60. @Controller public class WebController { @Autowired private GreetingApplicationService greetingApplicationService; @RequestMapping("/") public String home(Model model) { GreetingData greeting = greetingApplicationService.welcomePeople(); model.addAttribute("salutation", greeting.getSalutation()); model.addAttribute("name", greeting.getName()); return "home"; } }
  61. 61. @Controller public class WebController { @Autowired private GreetingApplicationService greetingApplicationService; @RequestMapping("/") public String home(Model model) { GreetingData greeting = greetingApplicationService.welcomePeople(); model.addAttribute("salutation", greeting.getSalutation()); model.addAttribute("name", greeting.getName()); return "home"; } }
  62. 62. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  63. 63. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  64. 64. @Service public class GreetingApplicationService { @Autowired private GreetingRepository repository; public GreetingData welcomePeople() { Greeting greeting = repository.firstGreeting(); GreetingData greetingData = new GreetingData(greeting); return greetingData; } }
  65. 65. @Service public class GreetingApplicationService { @Autowired private GreetingRepository repository; public GreetingData welcomePeople() { Greeting greeting = repository.firstGreeting(); GreetingData greetingData = new GreetingData(greeting); return greetingData; } }
  66. 66. @Service public class GreetingApplicationService { @Autowired private GreetingRepository repository; public GreetingData welcomePeople() { Greeting greeting = repository.firstGreeting(); GreetingData greetingData = new GreetingData(greeting); return greetingData; } }
  67. 67. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  68. 68. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  69. 69. @Repository public class JpaGreetingRepository implements GreetingRepository { @Autowired private HibernateGreetingRepository hibernateGreetingRepository; @Override public Greeting firstGreeting() { Iterable<GreetingTable> rows = hibernateGreetingRepository.findAll(); GreetingTable r = rows.iterator().next(); Greeting greeting = new Greeting( new Salutation(r.getSalutation()), new Name(r.getName())); return greeting; } }
  70. 70. @Repository public class JpaGreetingRepository implements GreetingRepository { @Autowired private HibernateGreetingRepository hibernateGreetingRepository; @Override public Greeting firstGreeting() { Iterable<GreetingTable> rows = hibernateGreetingRepository.findAll(); GreetingTable r = rows.iterator().next(); Greeting greeting = new Greeting( new Salutation(r.getSalutation()), new Name(r.getName())); return greeting; } }
  71. 71. @Repository public class JpaGreetingRepository implements GreetingRepository { @Autowired private HibernateGreetingRepository hibernateGreetingRepository; @Override public Greeting firstGreeting() { Iterable<GreetingTable> rows = hibernateGreetingRepository.findAll(); GreetingTable r = rows.iterator().next(); Greeting greeting = new Greeting( new Salutation(r.getSalutation()), new Name(r.getName())); return greeting; } }
  72. 72. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  73. 73. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  74. 74. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  75. 75. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  76. 76. @SpringBootApplication @EnableAutoConfiguration public class XpdemoApplication { public static void main(String[] args) { SpringApplication.run(XpdemoApplication.class, args); } }
  77. 77. @SpringBootApplication @EnableAutoConfiguration public class XpdemoApplication { public static void main(String[] args) { SpringApplication.run(XpdemoApplication.class, args); } }
  78. 78. ├── java │   └── de.neuland.xpdemo │   ├── XpdemoApplication.java │   ├── application │   │   ├── GreetingApplicationService.java │   │   └── GreetingData.java │   ├── domain.model │   │  ├── Greeting.java │   │ ├── GreetingInterest.java │   │ ├── GreetingRepository.java │   │ ├── Name.java │   │ └── Salutation.java │   └── port.adapter │   ├── persistence │   │   ├── GreetingTable.java │   │   ├── HibernateGreetingRepository.java │   │   └── JpaGreetingRepository.java │   └── web │   └── WebController.java └── resources ├── application.properties ├── static └── templates └── home.html
  79. 79. „Erkennung, Behandlung und Prävention
 von Infektionskrankheiten“ P R Ä V E N T I O N
  80. 80. Bedside-Test your Code! Quasar® AT0 Anti-TAnti-A
  81. 81. F R A G E N ?
  82. 82. Q U E L L E N https://www.flickr.com/photos/23967095@N00/ Vaughn Vernon, Implementing Domain Driven Design Johannes Siedersleben, Moderne Softwarearchitektur http://www.laputan.org/mud/

×