Notes on Clean Architecture With Spring talk

Mustafa Atik
2 min readMar 10, 2021
  • it is about facilitating all development experience
  • it touches every phase of a software lifecycle, development, and maintenance
  • eventually, the goal is to minimize the lifetime cost of a software
  • so the software needs to be maintainable, extendable
  • don’t bind to the framework or hardware too much
  • keep options open and make decisions at the latest possible moment

Layer architecture

UI/Controller → Service → Persistency

  • without any restrictions, the boundaries between layers can get blurred

This couples the persistency layer with the service layers, especially when spring annotations on entities are used and so most of the things are handled in the persistency layer, not in the business.

  • hard-to-test shortcuts
  • a controller can access the persistency layer
  • difficult to find a use-case

Do circles instead!

So the service or business layer should not depend on anything on the persistency layer, but the persistency layer should implement the interfaces of the domain layer. So the dependency is inverted.

If a database is changed, the business layer doesn’t have to be changed in this architecture. So it helps to achieve the single responsibility principle.

Hegaongs Instead!

vs

Reference:

--

--

Mustafa Atik

You can find my notes I take when learning something new or reading, watching. So, they only help me to refresh and remember what I’ve consumed.