it's a value! it's a reference!

Michael van Acken michael.van.acken at gmail.com
Sun Feb 24 09:04:02 UTC 2019


[Only subscribed to valhalla-dev this morning, so I cannot do a
proper reply to John Rose's email.]

| So we might get the pleasing symmetry of:
|
|    class (something with fields, methods, and supers)
|    reference* class  (classic, identity-testable, stateful, with natural
by-reference impl.)
|    value* class  (new fangled, identity-free, pure, with natural by-value
impl.)
|
|    object (anything instantiated from a class, incl. int some day: just
like C)
|    reference* object (instance of a reference class; you can test its
identity via. ref==)
|    value* object (instance of a value class; you can only test its value)
|
| The starred terms are adjectives which modify the following nouns.
| The starred terms are also candidates for replacement; get out your
| scrabble dictionaries!

I would like to toss in "entity" from the domain-driven design
glossary at http://dddcommunity.org/resources/ddd_terms/

[[Entity]] An object fundamentally defined not by its attributes, but
by a thread of continuity and identity.

Note: In the context of DDD, "identity" usually refers to a property
of a real world "object", modeled in software for example as an
attribute "customerID" of a class "Customer".  Eric Evans has more
on this in his DDD book (89pp "Entities (a.k.a Reference Objects)").


For completeness some related entries from the same glossary page:

[[Value Object]] An object that describes some characteristic or
attribute but carries no concept of identity.

[[Immutable]] The property of never changing observable state after
creation.

[[Life Cycle]] A sequence of states an object can take on between
creation and deletion, typically with constraints to ensure integrity
when changing from one state to another. May include migration of an
[[Entity]] between systems and different [[Bounded Contexts]].

-- mva


More information about the valhalla-dev mailing list