architecture design validation - lstefaniszyn/e-bank_ GitHub Wiki

Why ?

To address these questions:

  • How to proof application layer architecture is not only well defined slide ?

  • Does it have tangible structure in real coding structure?

  • How to synchronize diverse team technical skills against design architecture ?

Architecture layout

How ?

Set tool to address this demand

For this moment we can propose ArchUnit. It can help You to define this list of Why questions.

Defined rule: basic coding style

File rules to validate this style link

  • Be aware not to throw Generic Exception

  • Use Java.time instead Joda Time

  • Use BFLogger instead of log4j

  • Use BFLogger to print into console

Defined rule: architecture layers

In example e-bank application we have defined this architecture layout

Architecture layout rules

Files rules to validate this structure link

Rule - access level:

  • Controller layer can’t be used by any other layer

  • Service layer can be used only by Controller

  • Repository layer can be used only by Service

Rule - naming convention:

  • Controller, Service, Repository, Model have filename and package name align with its role

  • Controller, Service, Repository have adequate annotation @RestController, @Service, @Repository

Rule - dependence convention:

  • Controller implements OpenAPI API autogenerated files

  • Repository is an interface and extends org.springframework.data.repository.*

⚠️ **GitHub.com Fallback** ⚠️