This article is a synopsis of Effective Aggregate Design Part III: Gaining Insight Through Discovery .
Part 2 discussed how aggregates refer to each other and how to use eventual consistency to achieve specific business goals. In the third part, we will see how adherence to the rules of aggregates affects the design of the Scrum model (test project from the first part).
Rethinking Model Design
After a refactoring iteration that got rid of the large Product aggregate, the BacklogItem became a separate aggregate. The new version of the model can be seen in Figure 1. The BacklogItem aggregate contains a collection of Task instances. Each BacklogItem has a globally unique identifier - BacklogItemId. Association with other aggregates occurs through identifiers. The BacklogItem aggregate seems pretty small.
Despite the positive result after the first iteration, some concerns still exist. For example, the story attribute allows you to contain a large amount of text. Potential overhead costs may arise from this.
, , . . BacklogItem Task? ? ?
. :
, .
0 , . , done.
, done, .
. , . , 1 . , . , , , .
, , . , .
1, Task EstimationLogEntry. , . , Task BacklogItem, EstimationLogEntry Task? . , . .
, . , . 10 15, , 12 .
, . 4 16. , 12 , Scrum . , 12 (1 ). , 12 , , 12 , .
: ? , , 12 ( , ; ). 12 , 12 , 144 (12*12) . , .
, . Scrum , . (24) (6) 144. (24 12) , . 12 12 .
. 144 ? -? , ? , , ? .
. BacklogItem. , BacklogItem . , , .
, , , , , .
, . . . . BacklogItem. , .
, , . BacklogItem Task . . , .
0 , , . , done, , , done, .
? . , , . , . . 12- . , 144 12 , done.
. , (6 ), . , . , .
. , . , . . , , , . , , . , .
? 12 + 12 , 12 . , 12 . , 12 12 , 25 . . , . .
? , .
. , story points, . , . , , . , story points .
Task . . , , .
, , Tak BacklogItem. , , .
Task estimateHoursRemaining(), . :
public class TaskHoursRemainingEstimated implements DomainEvent {
private Date occurredOn;
private TenantId tenantId;
private BacklogItemId backlogItemId;
private TaskId taskId;
private int hoursRemaining;
...
}
. :
BacklogItemRepository BacklogItem .
TaskRepository Task, BacklogItem
BacklogItem estimateTaskHoursRemaining(), hoursRemaining Task. BacklogItem .
, . . , Task, , , .
public class TaskRepositoryImpl implements TaskRepository {
...
public int totalBacklogItemTaskHoursRemaining(
TenantId aTenantId,
BacklogItemId aBacklogItemId) {
Query query = session.createQuery(
"select sum(task.hoursRemaining) from Task task "
+ "where task.tenantId = ? and "
+ "task.backlogItemId = ?");
...
}
}
. , ? - ? ยซ UIยป. . .
Ajax, . , , Ajax . 143 144 , . Ajax Push.
, โ . , , , .
, Task BacklogItem. , . . 50 , 25, .
Task BacklogItem . , , .
, :
.
.
.
, .
, , , , - .