Repository navigation
Why Reference types for everything #312
Answered
by
xavierjohn
mtsikevich
asked this question in
Q&A
|
Hi @xavierjohn, I see all types are reference types. Is that because of ROP? Good project BTW |
Answered by
xavierjohn
Mar 2, 2026
Replies: 2 comments
|
Thanks! Actually the core ROP types — Result, Maybe, and Unit — are all readonly structs specifically to avoid heap allocations in the pipeline hot path. The DDD types (Entity, Aggregate, ValueObject) are classes because they model identity and state, which is standard for DDD building blocks. |
0 replies
Answer selected by
mtsikevich
|
Thank you @xavierjohn. Again, I know is in alpha but it already feels very nice to play around with |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! Actually the core ROP types — Result, Maybe, and Unit — are all readonly structs specifically to avoid heap allocations in the pipeline hot path. The DDD types (Entity, Aggregate, ValueObject) are classes because they model identity and state, which is standard for DDD building blocks.