Code Monkey home page Code Monkey logo

Comments (5)

shreddish avatar shreddish commented on June 29, 2024 1

yeah something is off. My guess is that the sprint.commit() should be accepting a BacklogItemCommited class. And the flow should be BacklogItem.commitTo(sprint) -> backlogItemCommitedEvent() -> sprint.commit(backlogItemCommited)

from iddd_samples.

shreddish avatar shreddish commented on June 29, 2024 1

Passing in CommittedBacklogItem would leak business logic into the application service. I suggest that if anything, the commit(BacklogItem backlogItem) language could be improved by this:

public void assignCommitted(BacklogItem backlogItem) {
}

And, no, this operation does not break the BacklogItem invariants, because the BacklogItem is not modified by the Sprint.

Okay that makes sense - however shouldn't the sprint be checking that the backlog item is in fact committed to itself? otherwise if called out of order you have a sprint that thinks a backlog item is committed to it and a backlog item that thinks it has not been committed to a sprint?

from iddd_samples.

VaughnVernon avatar VaughnVernon commented on June 29, 2024

You don't send events into the model. Events are translated to corresponding commands. The Sprint is accepting that a BacklogItem has been committed to it.

The commit() command could take on additional responsibility. For example, the Sprint might know the total commitment that can be taken on. If, for example, any given BacklogItem causes over-commitment (too much work for the Sprint), it could emit SprintOverCommitted, which could lead to a sub-process that helps the team understand how they might most effectively uncommit specific BacklogItems.

Still, that doesn't necessarily mean that the Sprint must emit a SprintCommittedBacklogItem. It depends on the downstream interests or possibly terminating an orchestration. But this is a simple in-context choreography that need not be managed and thus terminated. The commit() could still emit SprintCommittedBacklogItem, but apparently, at least for now, no one is interested in knowing that. (And this context is using KV storage, not Event Sourcing.)

from iddd_samples.

shreddish avatar shreddish commented on June 29, 2024

You don't send events into the model. Events are translated to corresponding commands. The Sprint is accepting that a BacklogItem has been committed to it.

The commit() command could take on additional responsibility. For example, the Sprint might know the total commitment that can be taken on. If, for example, any given BacklogItem causes over-commitment (too much work for the Sprint), it could emit SprintOverCommitted, which could lead to a sub-process that helps the team understand how they might most effectively uncommit specific BacklogItems.

Still, that doesn't necessarily mean that the Sprint must emit a SprintCommittedBacklogItem. It depends on the downstream interests or possibly terminating an orchestration. But this is a simple in-context choreography that need not be managed and thus terminated. The commit() could still emit SprintCommittedBacklogItem, but apparently, at least for now, no one is interested in knowing that. (And this context is using KV storage, not Event Sourcing.)

I apologize, I wasn't saying to send events into the model but rather the action of BacklogItem.commitTo() emits an event. A handler would listen to that event and then utilize the commit command on the sprint model to inform the sprint model that a backlog item is to be added to the sprint. What confused me a bit was that the sprint took a BacklogItem instead of a CommittedBackLogItem as the parameter. The backlog item being the parameter at first glance makes it seem that calling this would commit the backlog item to the sprint (which technically it does? So it appears like theres two places to commit a backlog item to a sprint). But doesn't this then bypass the model invariants in the BacklogItem that are checked when you call commitTo with a given sprint?

EDIT: Would adding a check in the sprint model's commit method that checks that the backlogItem's sprintId is assigned to the same sprint its being committed to make sense here?

from iddd_samples.

VaughnVernon avatar VaughnVernon commented on June 29, 2024

Passing in CommittedBacklogItem would leak business logic into the application service. I suggest that if anything, the commit(BacklogItem backlogItem) language could be improved by this:

public void assignCommitted(BacklogItem backlogItem) {
}

And, no, this operation does not break the BacklogItem invariants, because the BacklogItem is not modified by the Sprint.

from iddd_samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.