Domain-Driven Design (DDD) and Functional Programming (FP) have a lot of good things in common: DDD has borrowed many ideas from the FP community, and both share a common inspiration on established formalisms like maths.
Even in non functional languages like Java or C#, this combined set of practices from DDD, OO and FP helps craft simple and powerful code that reads well, that is very easy to test, that composes well and that can somehow describe itself.
We will have a closer look at some of these ideas, in the context of domain models inspired from real-world projects. From value objects and DSL to abstract algebra creatures like monoids and friends, we will show how all that translates into beautiful code that may influence your coding style!
8. WARNING
The following show features
no spectacular stunt, no live
coding, only trivial Java code.
You can re-create or re-enact
at home with no danger.
92. Color BLUE
Enable True
Timeout 30 +
=
Color RED
Enable False
Timeout 25
Desk FX
Color RED
Enable True
Timeout 25
Desk FX
Default Desk-specific
93. Color BLUE
Enable True
Timeout 30 +
=
Color RED
Enable False
Timeout 25
Desk FX
Color RED
Enable True
Timeout 25
Desk FX
Default Desk-specific
overw
rite
logical OR
m
in
94. Color BLUE
Enable True
Timeout 30 +
=
Color RED
Enable False
Timeout 25
Desk FX
Color RED
Enable True
Timeout 25
Desk FX
Default Desk-specific
overw
rite
logical OR
m
in
Values are monoids too!