This commit is contained in:
Correl Roush 2021-09-29 12:21:01 -04:00
parent 9981a97438
commit 6f17db399b
7 changed files with 47 additions and 2 deletions

View File

@ -1,4 +1,4 @@
:PROPERTIES:
:ID: 1882370a-e4df-42a3-ab5a-32b650b754a6
:END:
#+title: Static Type Checking
#+title: Static Typing

View File

@ -0,0 +1,19 @@
:PROPERTIES:
:ID: 5c2b9a4f-f007-421c-99e2-b2354b959b48
:ROAM_REFS: https://www.youtube.com/watch?v=PLFl95c-IiU
:END:
#+title: Scott Wlaschin - Talk Session: Domain Modeling Made Functional
- [[id:dfb5bf16-7479-4960-af39-80ad0ed3257e][Ubiquitous Language]]
- Persistence Ignorance (no foreign keys or other database-specific details)
- Communicating design decisions in code
+ Constraints, optionality, etc.
- [[id:67dab4eb-231f-4af0-bf26-b3cf6d83f9a3][Algebraic Data Types are composable]]
- [[id:63e60abc-66a7-478d-a272-45c0e7c99c32][Avoid primitives]], declaring domain types instead
- Types can be used as a domain modeling tool
- "Null is the Sauron of [[id:1882370a-e4df-42a3-ab5a-32b650b754a6][Static Typing]]"
- Constraints can be enforced when constructing distinct (wrapped) types.
- The [[id:dfb5bf16-7479-4960-af39-80ad0ed3257e][Ubiquitous Language]] evolves with the domain because it lives in the
evolving code.
- "Make illegal states unrepresentable!" - Yaron Minsky
- [[id:1882370a-e4df-42a3-ab5a-32b650b754a6][Static Typing]] gives you confidence to make changes

View File

@ -0,0 +1,7 @@
:PROPERTIES:
:ID: 67dab4eb-231f-4af0-bf26-b3cf6d83f9a3
:END:
#+title: Algebraic Data Types are composable
Because ADTs are separate from behavior, it's easy to combine them together to
make more complex types.

View File

@ -0,0 +1,9 @@
:PROPERTIES:
:ID: 63e60abc-66a7-478d-a272-45c0e7c99c32
:END:
#+title: Avoid primitives
Wrapper types keep types distinct, e.g. a customer id can be represented as an
=int=, but /is not/ an =int=. This makes the domain model clearer, and they
cannot be mixed up accidentally (e.g. mis-ordered parameters) as the type
checker will prevent it.

View File

@ -0,0 +1,6 @@
:PROPERTIES:
:ID: dfb5bf16-7479-4960-af39-80ad0ed3257e
:END:
#+title: Ubiquitous Language
A common set of terms to describe the elements of a domain in [[id:22cd7cdb-092c-4535-b1aa-2186cba4c715][Domain Driven Design]].

View File

@ -0,0 +1,4 @@
:PROPERTIES:
:ID: 22cd7cdb-092c-4535-b1aa-2186cba4c715
:END:
#+title: Domain Driven Design

View File

@ -4,4 +4,4 @@
:END:
#+title: Lessons Learned: Avoiding Primitives in Elm
Discusses using specialized wrapper types in Elm.
Discusses using specialized wrapper types to [[id:63e60abc-66a7-478d-a272-45c0e7c99c32][Avoid primitives]] in Elm.