Clean architecture
Andrzej Bednarz
andbedwroc@gmail.com
https://github.com/andbed/clean-architecture
05.07.2014
A new project
Self testing software
Clean architecture
Demo
• Basic structure
• Input/output
Application Core
Source: Uncle Bob, http://blog.8thlight.com/uncle-bob/2011/11/22/Clean-Architecture.html
Controller -> Interactor
Source: Uncle Bob, http://blog.8thlight.com/uncle-bob/2011/11/22/Clean-Architecture.html
Controller <- Interactor
Source: Uncle Bob, http://blog.8thlight.com/uncle-bob/2011/11/22/Clean-Architecture.html
Source: Uncle Bob, http://blog.8thlight.com/uncle-bob/2011/11/22/Clean-Architecture.html
Traditional layered architecture
Clean architecture
Source: Uncle Bob, http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
Hexagonal Architecture
Summary
We are still on the way...
Excellent testability
Every component and layer could be tested in isolation
Clearly defined separation of concerns
Flexibility
Gradual architecture introduction
Lots of additional classes and interfaces
Lots of DTOs and conversions
Cost
Source: David Heinemeier Hansson, https://gist.github.com/dhh/4849a20d2ba89b34b201
Based on: Jim Weirich's "Decoupling from Rails"
Source: David Heinemeier Hansson, https://gist.github.com/dhh/4849a20d2ba89b34b201
Based on: Jim Weirich's "Decoupling from Rails"
Source: David Heinemeier Hansson, https://gist.github.com/dhh/4849a20d2ba89b34b201
Based on: Jim Weirich's "Decoupling from Rails"
Not new
Not only Java related
Not a rocket science
Not home-grown
References
http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
http://blog.8thlight.com/uncle-bob/2011/11/22/Clean-Architecture.html
http://blog.8thlight.com/uncle-bob/2011/09/30/Screaming-
Architecture.html
http://alistair.cockburn.us/Hexagonal+architecture
http://www.growing-object-oriented-software.com/
http://jeffreypalermo.com/blog/the-onion-architecture-part-1/
http://martinfowler.com/articles/is-tdd-dead/
https://groups.google.com/forum/#!forum/clean-code-discussion
http://en.wikipedia.org/wiki/Data,_context_and_interaction
http://andrzejonsoftware.blogspot.com/2013/12/the-four-architectures-that-
will.html
Object Oriented Software Engineering: A Use Case Driven Approach, Ivar
Jacobson, 1992
Examples
https://github.com/andbed/clean-architecture
http://obvious.retromocha.com/
https://github.com/michelchenrich/crudrefactorkata.git
https://github.com/lukasz-duda/ArchitectureSample
http://www.whitewashing.de/2012/08/13/oop_business_applic
ations_entity_boundary_interactor.html
Thank you!

Clean architecture