Quantcast
Channel: CSLA .NET
Viewing all articles
Browse latest Browse all 764

EditableRoot containing referenced ReadOnlyRoot

$
0
0

I wanted to add what seemed a simple enough relationship property to an EditableRoot object but have come unstuck at the first hurdle.

An example would be an editable Project with a read only ProjectStatus, the project is editable and so is which status is assigned but not the status itself.

I can see three scenarios but each one has it's own negative effects.

EditableRoot contains ReadOnlyRoot property - roots are not supposed to own other roots

EditableRoot contains ReadOnlyChild property - the read only object is not a really a child object

EditableRoot contains Id of ReadOnlyRoot and has a reference to a ReadOnlyRoot - Id could be set to an invalid value and would require extra checks to ensure it existed.


Viewing all articles
Browse latest Browse all 764

Trending Articles