Why Reference types for everything #312
-
|
Hi @xavierjohn, I see all types are reference types. Is that because of ROP? Good project BTW |
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you @xavierjohn. Again, I know is in alpha but it already feels very nice to play around with |
Beta Was this translation helpful? Give feedback.
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.