![Page 1: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/1.jpg)
Oliver B. Fischer (@sweblogtweets)
Mind the GapArchitektur versus Code
![Page 2: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/2.jpg)
2
![Page 3: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/3.jpg)
3
Was ist Software Architektur?
Eine strukturierte oder hierarchische Anordnung der Systemkomponenten sowie die BeschreibungIhrer Beziehungen.
Helmut Balzert
![Page 4: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/4.jpg)
4
Was ist Software Architektur?
The fundamental organisation of a system embodiedin its components, their relationships to each other,and the environment, and the principles guidingits design and evolution.
IEEE 1471-2000
![Page 5: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/5.jpg)
5
Was ist Software Architektur?
...from the plethora of definitions the vary conceptof Software Architecture is fuzzy to the pointof utter uselessness...
SEI @ CMI: John Carter
A lot of folks mean:
That peculiar consistency and homogenity of Design that would give arise to the ease of use and reuse, which is wished for by the developer who calls himself „The Software Architect“.
...[which] implodes immediatly on the appointment of a second Software Architect...
![Page 6: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/6.jpg)
6
Ziele von Software Architektur
Software-Qualität
Prozess-Qualität Produkt-Qualität
Wartbarkeit Brauchbarkeit
Prüfbarkeit Änderbarkeit Portabilität
Lesbarkeit Strukturiertheit Einfachheit
![Page 7: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/7.jpg)
7
Ziele von Software Architektur
Durch Software Architektur wollen wir erhalten:
Wartbare Software Verständliche Software Anpassbare bzw. Erweiterbare Software Effiziente Software
![Page 8: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/8.jpg)
8
Wann Software Architektur entsteht
Software Architektur entsteht sobald sich zwei Personen über einen Aspekt eines Dings oder das Zusammenspiel zweier Dinge abstimmen.
![Page 9: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/9.jpg)
9
Wann Software Architektur entsteht
Software Architektur entsteht sobald sich zwei Personen [über einen Aspekt eines Dings oder das Zusammenspiel zweier Dinge] abstimmen.
![Page 10: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/10.jpg)
10
Software Architektur ist Kommunikation
Software Architektur ist [auch] Kommunikation über Strukturen, Beziehungen und Prinzipien...
...um besser und leichter arbeiten zu können.
![Page 11: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/11.jpg)
11
Software Architektur ist Kommunikation
Software Architektur muß Verständnis schaffen, nicht nur für das Wie, sondern auch für das Warum!
![Page 12: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/12.jpg)
12
Software Architektur ist Kommunikation
Drei Rollen-Model
Domainexperte Entwickler User
![Page 13: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/13.jpg)
13
Software Architektur ist Kommunikation
Einfachster Fall
Domainexperte Entwickler User
![Page 14: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/14.jpg)
14
Software Architektur ist Kommunikation
Es wird schwieriger...
Domainexperte Entwickler User
![Page 15: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/15.jpg)
15
Software Architektur ist Kommunikation
Es wird schwieriger...
Domainexperte Entwickler User
![Page 16: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/16.jpg)
16
Software Architektur ist Kommunikation
Das Team wird größer
Domainexperte Entwickler User
![Page 17: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/17.jpg)
17
Software Architektur ist Kommunikation
Es verteilt sich...
Team in Berlin Team in München
![Page 18: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/18.jpg)
18
Software Architektur ist Kommunikation
Es verteilt sich geographisch und kulturell
Ich spreche Deutsch...
Я говорю по-русский
I speak Englisch
![Page 19: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/19.jpg)
19
Software Architektur ist Kommunikation
Und dann auch zeitlich...
![Page 20: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/20.jpg)
20
Software Architektur ist Kommunikation
Ach ja: Microservices...
![Page 21: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/21.jpg)
21
Altlasten & Technische Schulden
Veraltete Libraries....
Neue Lösungsansätze
Divergierende Makroarchitektur
![Page 22: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/22.jpg)
22
Wir brauchen Regeln
Hast Du mal Zeit?Ja, was willst Du denn?
Ich habe da eine Idee.Laß mal hören...
......
Ja, so machen wir das!
§1. Jedes System...§2. Jede Methode...§3. Auf jedem Server...§4. ...
![Page 23: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/23.jpg)
23
Wir brauchen Regeln
§1. Jedes System...§2. Jede Methode...§3. Auf jedem Server...§4. ...
Regeln entstehen meist informell
![Page 24: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/24.jpg)
24
Wir brauchen Regeln
Informelle Regeln haben Grenzen...
Größe des Teams erschwert Kommunikation Entstehung von Inselwissen Fluktuation Charaktertypen
![Page 25: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/25.jpg)
25
Lösungsansatz
Überführung von informellen Regeln in formale Regeln.
![Page 26: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/26.jpg)
26
Lösungsansatz
„Wir schreiben das auf!“„Wo?“
„Im Wiki!“
Zitat „Wiki, der Ort wo Informationen zum Sterben hingehen.“
![Page 27: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/27.jpg)
27
Lösungsansatz
„Wir schreiben das auf!“„Wo?“
„Im Wiki!“
W here I informationK ills I tself
![Page 28: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/28.jpg)
28
Lösungsansatz
Dokumentation!=
Kommunikation
![Page 29: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/29.jpg)
29
Lösungsansatz
Helfen Reviews?
![Page 30: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/30.jpg)
30
Lösungsansatz
Helfen Tools?
![Page 31: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/31.jpg)
31
jQAssistant
Mind The Gap!Architecture vs. Code
![Page 32: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/32.jpg)
32
http://jQAssistant.org
Open Source- GPL v3
Current release: 1.1.3- initiated: 03/2013- first stable release: 04/2015
Neo4j Community Edition embedded- no installation necessary
![Page 33: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/33.jpg)
33
The Idea- Scan software structures
- Store in a database
- Execute queries Add higher level concepts Find constraint violations
- Create Reports
Provide feedback to developers within build process
Database
Find all…
![Page 34: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/34.jpg)
34
Command Line/
Maven
Scan
Analyze
Report
Plugins
Plugins
Plugins
![Page 35: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/35.jpg)
35
Available scanner plugins
Plugin API is public
*.class
RDBMS Schema
GitJaCoCo
FindBugsCheckStyle
LiquibaseJAR, WAR, EARZIP
application.xmlweb.xml
MANIFEST.MF /META-INF/services/*
beans.xml
pom.xml surefire-reports.xml
GZ
*.properties
*.xsd
M2 Repository
*.yaml
![Page 36: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/36.jpg)
36
Software As A Graph
Mind The Gap!Architecture vs. Code
![Page 37: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/37.jpg)
37
All we need is…- Nodes - Labels - Properties - Relationships
Modeling is just…- Taking a pen- Drawing the structures on a whiteboard (i.e. the database)
We don‘t need…- Foreign keys- Tables and schemas- Deep knowledge in graph theory
Type
EXTENDSfqn:org.springframework.samples.
petclinic.model.Owner
![Page 38: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/38.jpg)
Project
Artifact
Maven
CONTAINS
Package
name:org
CONTAINS
Package
name:springframework CONTAINS
Package
name:petclinic
Package
CONTAINS
name:model
name:petclinic
CONTAINS
Package
name:samples
CREATES
![Page 39: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/39.jpg)
RETURNS
READS
Field
DECLARES
name:address
Package
name:model
Class
Type
CONTAINS
fqn:org.springframework.samples.petclinic.model.Person
name:Person
Annotation
ANNOTATED_BY
Type
OF_TYPEfqn:javax.persistence.MappedSuperclass
Type
EXTENDS
Class
fqn:org.springframework.samples.petclinic.model.Owner
name:Owner
Type
OF_TYPE
fqn:java.lang.String
DECLARES
Method
name:getAddress()
Annotation
ANNOTATED_BY
Type
OF_TYPEfqn:javax.persistence.Entity
![Page 40: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/40.jpg)
40
TypeType
Class
EXTENDS
Explore an application using queries- Which class extends from another class?
Let‘s convert this to ASCII art… - () as nodes- -[]-> as directed relationships
![Page 41: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/41.jpg)
41
TypeType
Class
EXTENDS
Explore an application using queries- Which class extends from another class?
Let‘s convert this to ASCII art… - () as nodes- -[]-> as directed relationships
()-[]->()
![Page 42: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/42.jpg)
42
C2Type
C1Type
Class
EXTENDS
Explore an application using queries- Which class extends from another class?
Let‘s convert this to ASCII art… - () as nodes- -[]-> as directed relationships
(c1)-[]->(c2)
![Page 43: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/43.jpg)
43
C2Type
C1Type
Class
EXTENDS
Explore an application using queries- Which class extends from another class?
Let‘s convert this to ASCII art… - () as nodes- -[]-> as directed relationships
(c1)-[:EXTENDS]->(c2)
![Page 44: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/44.jpg)
44
Explore an application using queries- Which class extends from another class?
Let‘s convert this to ASCII art… - () as nodes- -[]-> as directed relationships
(c1:Class)-[:EXTENDS]->(c2:Type)
C2Type
C1Type
Class
EXTENDS
![Page 45: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/45.jpg)
45
Explore an application using queries- Which class extends from another class?
Pattern matching is the core principle of Cypher
MATCH (c1:Class)-[:EXTENDS]->(c2:Type)RETURN c1.fqn, c2.fqn
C2Type
C1Type
Class
EXTENDS
![Page 46: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/46.jpg)
46
Demo #1
Mind The Gap!Architecture vs. Code
http://jqassistant.org/get-started/
![Page 47: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/47.jpg)
47
Building The Bridge
Mind The Gap!Architecture vs. Code
![Page 48: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/48.jpg)
48
Analyze - Execution of rules
Defined in AsciiDoc or XML documents
- Concepts Enrich data model
- Constraints Detect violations
- Group Allow different execution profiles
![Page 49: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/49.jpg)
49
ConstraintGroup
Concept ConceptConcept
Includes
Requires Requires
Requires
![Page 50: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/50.jpg)
50
Concept == JPA Entities
[[jpa2:Entity]].Labels all types annotated with @javax.persistence.Entity with Jpa and Entity.[source,cypher,role=concept]----MATCH (t:Type)-[:ANNOTATED_BY]->()-[:OF_TYPE]->(a:Type)WHERE a.fqn ="javax.persistence.Entity" SET t:Jpa:EntityRETURN t AS Entity----
![Page 51: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/51.jpg)
51
Concept
Entity
JpaType
Class
fqn:org.springframework.samples.petclinic.model.Owner
name:Owner
Annotation
ANNOTATED_BY
Type
OF_TYPEfqn:javax.persistence.Entity
![Page 52: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/52.jpg)
52
Constraint
[[model:JpaEntityInModelPackage]].All JPA entities must be located in packages named "model".[source,cypher,role=constraint,requiresConcepts="jpa2:Entity"]----MATCH (package:Package)-[:CONTAINS]->(entity:Jpa:Entity)WHERE package.name <> "model"RETURN entity AS EntityInWrongPackage----
![Page 53: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/53.jpg)
53
Group
[[default]][role=group,includesConstraints="model:JpaEntityInModelPackage"]== Naming Rules
The following naming rules apply:- <<model:JpaEntityInModelPackage>>
![Page 54: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/54.jpg)
54
AsciiDoc Wiki syntax Rendering to
- DocBook - HTML- PDF
Executable specification- Coding rules- Design & Architecture
![Page 55: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/55.jpg)
55
Demo #2
Mind The Gap!Architecture vs. Code
http://github.com/buschmais/spring-petclinic
![Page 56: Mind the Gap - Architecture versus Code @ W-JAX 2016](https://reader035.vdocuments.net/reader035/viewer/2022062503/58f9b5fd1a28abb5098b45cd/html5/thumbnails/56.jpg)
56
- Holistic view on code structure and system architecture
- Exploration of existing structures
- Validation of rules
- Executable architecture and design specification
- Rules using terms from architecture & design language