This project is read-only.

ImmutableAttribute

Immutable attribute is applied to:
  • properties of entity interfaces in the data model
  • property must be reference to another entity

Meaning of ImmutableAttribute is that data which is referenced would remain the same version even if entities get new versions in future. Another way to say this is that data which is referenced will remain the same in future, or that it is immutable.

Immutability is applied to all sub-references as well, which means that data can be navigated and read having the same values when it was set.

Immutable reference can be set to new value explicitly. Referenced object(s) are read only, attempt to change immutable data would result in error.

As a demonstration for this concept see example Database with immutable data

PrimaryKeyAttribute

This attribute is used to mark:
  • properties of entity interface
  • property must be scalar
  • property must not be RevisionId

Meaning of the attribute is when entity is added to the IIndexedCollection, it will be used as primary key. Primary key can be used to retrieve element from the collection, and it is used to order elements in the collection. Primary key must be unique for a given collection.

RevisionIdAttribute

This attribute is used to mark:
  • properties of entity interface
  • property must be of type Guid
  • property must be read-only

Meaning of the attribute is that declared property will return internal ID of the object, which may be used to identify the object state externally.
With the given internal ID the object state can be re-constructed again with exactly the same state.

ConcurrentAttribute

This attribute is used to mark entity interfaces. It marks type as allowed to be changed from different workspaces at the same time, which makes sense only with IsolationLevel.Snapshot.

OverrideAttribute

This attribute is used to mark:
  • properties of entity interface
  • entity must be marked with ConcurrentAttribute

Meaning of this attribute is that in case of conflict the new value will override the last commited value.

Last edited Mar 7, 2012 at 3:03 PM by nenadsabo, version 5

Comments

No comments yet.