You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,17 +11,18 @@ Along with these principles, they also introduced certain practices that made se
11
11
12
12
However, over time, some of these practices have been taken to extremes. You'll often hear recommendations like:
13
13
14
-
*"Your business logic should depend only on the JDK — no external libraries allowed."
15
-
*"Create your own logging abstraction."
16
-
*"Avoid framework annotations and write XML instead to keep your core 'pure'"
14
+
* Your business logic should depend only on the JDK — no external libraries allowed
15
+
* Create your own logging abstraction
16
+
* Avoid framework annotations and write XML instead to keep your core 'pure'
17
17
18
18
While these ideas may sound elegant in theory, in practice they often add unnecessary complexity.
19
19
Modern frameworks and libraries already solve many of these recurring problems. In the real world, companies rarely switch frameworks, databases, or message brokers overnight. Building multiple abstraction layers just to guard against that possibility usually results in more boilerplate and less productivity.
20
20
21
21
I've seen teams implementing Clean, Hexagonal, or Onion architectures spend a surprising amount of time on:
22
22
23
-
* Copying data objects across multiple layers,
24
-
* Creating endless interfaces with only one implementation,
23
+
* Endless copying of data from one layer to another
24
+
* Creating unnecessary interfaces
25
+
* Creating endless interfaces with only one implementation
25
26
* Re-implementing features (like cross-cutting concerns) that frameworks already handle elegantly.
26
27
27
28
With the tools we have today — Mockito for mocking concrete classes, Testcontainers for testing with real dependencies, and frameworks like Spring Boot or Quarkus that already abstract away much of the complexity — many of these additional layers are simply unnecessary.
0 commit comments