Project Layout
Project layout, Domain driven development, Single Responsibility Principle
Project structure
we will be using monorepo style project layout, utilizing gradle multi-project build system.
sub-projects
apps
contains runnable
apps
. i.e., microservices, cli tools, ETL pipelines etccan be build into
fatJars
and/ordocker
imagesthere should be only one entry point per app. i.e, one top-level class with
main()
method.apps
imports locallibs
as neededimplementation(project(":libs:dlib"))
libs
libraries are two types:
core
andshared
core
type libraries are shared libraries, imported in allapps
or in allapps
of specific type. e.g.,models
,kbeam
shared
type libraries are reusable libraries focused on solving only one type of problem, e.g.,encryption-utils
avro-utils
Rules
Keep core liberties as slim as possible (zero or fewer dependencies)
Keep shared liberties focus on doing one thing. i.e,
avro-utils
,encryption-utils
,beam-utils
etcAdd system-wide 3-party dependencies in root
build.gradle.kts
and project specific dependencies in sub-project'sbuild.gradle.kts
Keep all 3-party dependencies' version management in
gradle.properties
UpToDate.
Last updated