Slides of the talk I held at 50th meeting of Java User Group Saxony. @springcentral
Whoops!Where did myarchitecture go?Architecture management for Java applications!Oliver Gierke
View Slide
Background5 years of consultingLots of code reviewsEoin Woods‘ talk on InfoQLot of input from fellows
"If you thinkarchitecture isexpensive, try noarchitecture.
Macro VS. MicroArchitecture
OrdersInventoryBilling
OrdersInventoryBillingMacro-ArchitectureJMSRESTAMQP
OrdersInventoryBillingMacro-ArchitectureMicro-ArchitectureJMSRESTAMQP
JRubyJavaScalaMacro-ArchitectureMicro-ArchitectureAMQPJMSREST
Neo4jRDBMSMongoDBMacro-ArchitectureMicro-Architecturefrom Stefan Tilkov - Breaking the MonolithJMSRESTAMQP
RoadmapDivide and conquerOf layers and slicesA plain Java based approach
Architecture 101
Know yourdependencies
Explicit / Visibledependencies
GranularityModulesLayersVertical slicesSubsystems
GranularityJava ARchivePackageClass
Divide andconquer
Component
ComponentSingle unit to understand
ComponentSingle unit to change
ComponentScope of risk of change
BSmaller unit to understandA
BReduced risk of changeA
BCost of separationA
BDefinition and maintenanceof dependenciesA
"Meanwhile, in myfriend’s project…
How do I add a feature?
How do I add a feature?New Feature© Eberhard Wolff
Of layersand slices…
PresentationServiceData Access
PresentationServiceData AccessAccount Customer Core
LayersWell understoodKnown to developersLess important to business
SlicesHardly understoodNew to developersKey for business requirements
"How to implementan architectureinside a codebase?
ArchitectureVS.Codebase
"How to maintainan architectureinside a codebase?
Code analysisJDependSonar
SonargraphFormerly known as SonarJ
Demo
jQAssistanthttp://github.com/buschmais/jqassistant
A plain Javabased approach
"How far can we getwith plain Javameans only?
Packages
….layer.slice….slice.layer….slice
….web.core….service.core….repository.core
….core.web….core.service….core.repository
….core….customer….account
"Why the f#$kshould I even care?
"Does it makea difference?
Dependencymanagement
"You only need tomanage, what youcan refer to…
Layers firstLeaks slice internalsLower layers visible to everyone
Slices first/onlyStart with package per sliceExpose interfaces and domain typesKeep implementations private
Slices first/onlyEncapsulates business moduleInternals understood anyway
"Start with lesspackages and theleast visibilitypossible…
Take-awaysKnow your dependenciesOn every granularityStart as strict as possibleGet lenient where necessary
ResourcesSpring Data JPA @ GitHubSonargraphjQAssistantBlogpost
Sample Codehttp://github.com/olivergierke/ whoops-architecture
Oliver GierkeSpring Data Project Lead![email protected]olivergierkewww.olivergierke.de
Thanks & CreditsEoin Woods - Talk @ InfoQStefan Tilkov - Talk @ InfoQEberhard Wolff - Slides @ Slideshare