Results 1 to 1 of 1
Thread: Immutability of ValueObjects
Sep 4, 2010, 11:46 #1
Immutability of ValueObjects
I understand that ValueObjects are supposed to be used for things that do not change once set. However, I am a bit confused on how to proceed on something that needs to be changed, but still seems to scream use value objects. Here's the scenario...
I have an entity with about 30 or so boolean fields. These fields are groupable into 5 smaller groups of related fields. In addition. two other entities use one or more of these same field groups. What I wanted to do was make these groups value objects so all entities could use them, and at the same time reduce the number of fields present at the entity level. The problem is, these fields must be changable as an administrator may routinely update the values and settings.
Is it permissable to use a value object in this way? Or is there a different convention for this?
The practical example would be...
Mask (overrides member permissions for a given forum)
Moderator (overrides moderator permissions for a given forum)
Due to the number of actual permissions, these entities would be rather large if included at that level. Using valueobjects instead would better manage them, however, I'd be stepping on the toes of the valueobjects actual role in things.