Class AggregateRoot
Aggregate root is a meaningful object in the domain. It can be viewed as a write
boundary for entities and value objects that will maintain write consistency.
Usually it represents a single table, but can span several tables and can be
used like document or similar data structure. Since every aggregate is also an
entity, it has a unique identification represented by its URI.
DSL example:
module Todo {
aggregate Task {
timestamp startedAt;
timestamp? finishedAt;
int? priority;
List<Note> notes;
}
value Note {
date entered;
string remark;
}
}
-
NGS\Patterns\Searchable
implements
NGS\Patterns\IDomainObject
-
NGS\Patterns\Identifiable
implements
NGS\Patterns\IIdentifiable
-
NGS\Patterns\AggregateRoot
Methods summary
public
NGS\Patterns\AggregateRoot
|
#
persist( )
Persists object on the server. Insert is performed if object's URI is not
set, otherwise, if URI is set, current object is updated.
Persists object on the server. Insert is performed if object's URI is not
set, otherwise, if URI is set, current object is updated.
Returns
|
public
NGS\Patterns\AggregateRoot
|
#
delete( )
Deletes object from the server
Deletes object from the server
Returns
Throws
|
public
NGS\Patterns\AggregateRoot
|
|